Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 633 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 633 Bytes

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!