Registry / async / async-cell

async-cell

JSON →
library0.2.3rscratesunverified

A Cell<Option<T>> that you can await on, enabling async access to shared state.

# Cargo.toml [dependencies] async_cell = "0.2.3"
INSTALL
IMPORT
SIG · ASYNC-CELL
A
async-cell
asyncrustv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncCell
use async_cell::AsyncCell;

Sets and gets a value asynchronously using AsyncCell.

use async_cell::AsyncCell; #[tokio::main] async fn main() { let cell = AsyncCell::new(); cell.set(42).await; let value = cell.get().await; assert_eq!(value, Some(&42)); }
Debug
Known issues
gotchaRequires async runtime (tokio) for await operations.
fix
Add `tokio` dependency and use `#[tokio::main]`.
affects: >=0.2.0
Upgrade
Version history
0.2.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
42
OpenAI (training)
1
Resources
async-cell — cargo add async-cell · libregistry