async-once-cell

Crates.ioasync-once-cell
lib.rsasync-once-cell
version0.5.3
sourcesrc
created_at2021-08-08 22:57:24.550974
updated_at2023-07-09 02:13:09.088697
descriptionAsync single assignment cells and lazy values.
homepage
repositoryhttps://github.com/danieldg/async-once-cell
max_upload_size
id433382
size71,967
(danieldg)

documentation

https://docs.rs/async_once_cell

README

Crates.io API reference

Overview

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!

Commit count: 36

cargo fmt