matklad/once_cell
Rust library for single assignment cells and lazy statics without macros observed · 2026-08-28
Health v2 · maintenance only
64/100
- Activity 71
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2954
- days_rel: n/a
- days_push: 174
- n_releases_24m: 0
Adoption not part of the score
2089 stars · 124 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Rust library providing single assignment cells (OnceCell) and lazy initialization types (Lazy) without macros. It offers a macro-free alternative to lazy_static! with sync and unsync variants.
Use cases
- initialize global static data lazily in Rust
- replace lazy_static! macro with plain code
- store a value that is assigned at most once
- share lazily-built HashMap or Mutex across threads
- defer expensive computation until first access
When to choose
- you need lazy statics or single-assignment cells in Rust without macros
- you want a minimal, widely-adopted dependency for lazy initialization
- you need both thread-safe and single-threaded lazy cell variants
When to avoid
- you are on Rust 1.70+ and std's OnceCell/LazyLock suffice
- you need reassignment or interior mutability beyond single assignment
- you need async-aware lazy initialization (consider async_once_cell)
Facets
library · maturity stable
concurrency developer-tools developer-tools programming-languages rust cross-platform lazy-static single-assignment no-macros initialization
2 sources
- readme: https://github.com/matklad/once_cell · fetched 2026-08-28 · 2331182c8b5a
- registry_crates: https://crates.io/api/v1/crates/once_cell · fetched 2026-08-29 · 80c08459fb86
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| matklad/once_cell | main | 64 |
For agents
markdown · JSON · MCP: product_card(name="matklad/once_cell")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem