reference-counted-singleton

Reference-counted singleton whose protected data can be recreated as needed


Keywords
data-structure, static, concurrency, cache, cross-platform
License
MIT

Documentation

crates.io docs.rs license

Reference-Counted Singleton

[RefCountedSingleton] is a reference-counted singleton whose protected data can be recreated as needed.

The protected data is created when [RefCountedSingleton::get_or_init] is called. That function returns an [RCSRef] reference to the singleton.

[RCSRef] instances can be cloned as needed. The last [RCSRef] reference drops the data. Calling [RefCountedSingleton::get_or_init] again recreates the data.

Versioning

This project adheres to Semantic Versioning. The CHANGELOG.md file details notable changes over time.