async-once-cell

Crates.ioasync-once-cell
lib.rsasync-once-cell
version0.5.4
sourcesrc
created_at2021-08-08 22:57:24.550974
updated_at2024-10-07 01:51:24.666886
descriptionAsync single assignment cells and lazy values.
homepage
repositoryhttps://github.com/danieldg/async-once-cell
max_upload_size
id433382
size71,234
(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: 41

cargo fmt