Crates.io | async-once-cell |
lib.rs | async-once-cell |
version | 0.5.4 |
source | src |
created_at | 2021-08-08 22:57:24.550974 |
updated_at | 2024-10-07 01:51:24.666886 |
description | Async single assignment cells and lazy values. |
homepage | |
repository | https://github.com/danieldg/async-once-cell |
max_upload_size | |
id | 433382 |
size | 71,234 |
async_once_cell
is a version of once_cell
that adds support for async initialization of cells. The short version of the
API is:
impl OnceCell<T> {
fn new() -> OnceCell<T>;
fn get(&self) -> Option<&T>;
async fn get_or_init(&self, init: impl Future<Output=T>) -> &T;
}
More patterns and use-cases are in the docs!