#static #concurrency #cross-platform #data-structure #cache

reference-counted-singleton

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

3 releases

0.1.2 Sep 3, 2022
0.1.1 Jul 29, 2021
0.1.0 Jun 9, 2021

#244 in Concurrency

Download history 2559/week @ 2023-01-18 2600/week @ 2023-01-25 2363/week @ 2023-02-01 3630/week @ 2023-02-08 4400/week @ 2023-02-15 4035/week @ 2023-02-22 3199/week @ 2023-03-01 5388/week @ 2023-03-08 6799/week @ 2023-03-15 12897/week @ 2023-03-22 6520/week @ 2023-03-29 3116/week @ 2023-04-05 3392/week @ 2023-04-12 3510/week @ 2023-04-19 3098/week @ 2023-04-26 3197/week @ 2023-05-03

13,688 downloads per month
Used in 7 crates (via selinux)

MIT license

15KB
267 lines

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 functions 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.

No runtime deps