8 releases

0.2.6 Dec 24, 2021
0.2.5 Dec 23, 2021
0.2.1 Oct 22, 2020
0.1.0 Jul 16, 2020

#255 in Concurrency

Download history 18914/week @ 2024-12-17 8935/week @ 2024-12-24 13408/week @ 2024-12-31 20242/week @ 2025-01-07 20952/week @ 2025-01-14 20749/week @ 2025-01-21 20275/week @ 2025-01-28 25929/week @ 2025-02-04 27047/week @ 2025-02-11 27798/week @ 2025-02-18 29799/week @ 2025-02-25 27729/week @ 2025-03-04 24962/week @ 2025-03-11 23872/week @ 2025-03-18 29422/week @ 2025-03-25 21358/week @ 2025-04-01

104,189 downloads per month
Used in 18 crates (17 directly)

MIT/Apache

10KB
176 lines

async_once

async once tool for lazy_static

Examples

   use lazy_static::lazy_static;
   use tokio::runtime::Builder;
   use async_once::AsyncOnce;

   lazy_static!{
       static ref FOO : AsyncOnce<u32> = AsyncOnce::new(async{
           1
       });
   }
   let rt = Builder::new_current_thread().build().unwrap();
   rt.block_on(async {
       assert_eq!(FOO.get().await , &1)
   })

run tests

   cargo test
   wasm-pack test --headless --chrome --firefox

License: MIT OR Apache-2.0

No runtime deps