{"id":59739,"library":"async-once","title":"async-once","description":"async once tool for lazy_static","status":"active","version":"0.2.6","language":"rust","source_language":null,"source_url":"https://github.com/hjiayz/async_once","tags":["async","once","lazy","initialization","tokio"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nasync_once = \"0.2.6\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add async_once","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"AsyncOnce","correct":"use async_once::AsyncOnce;"}],"quickstart":{"code":"use async_once::AsyncOnce;\nuse lazy_static::lazy_static;\n\nlazy_static! {\n    static ref CONFIG: AsyncOnce<String> = AsyncOnce::new();\n}\n\n#[tokio::main]\nasync fn main() {\n    let val = CONFIG.get_or_init(|| async { \"hello\".to_string() }).await;\n    println!(\"{}\", val);\n}","lang":"rust","description":"Initialize a value asynchronously once using AsyncOnce"},"warnings":[{"fix":"Add `tokio` or another async runtime as a dependency and use `#[tokio::main]` or similar.","message":"Requires an async runtime (e.g., tokio) to call `get_or_init`.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'async':2,4,10 'async-onc':1 'initi':13 'lazi':8,12 'static':9 'tokio':14 'tool':6","created_at":"2026-06-16T17:15:01.617361+00:00","updated_at":"2026-06-16T17:15:01.617361+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/hjiayz/async_once","github":"https://github.com/hjiayz/async_once","docs":"https://docs.rs/async_once/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["async"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}