#reference-counting #cross-platform #cache #static #data-structures

reference-counted-singleton

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

6 releases

0.1.5 Sep 13, 2024
0.1.4 Mar 27, 2024
0.1.3 Jan 8, 2024
0.1.2 Sep 3, 2022
0.1.0 Jun 9, 2021

#67 in FFI

Download history 2158/week @ 2024-08-22 1531/week @ 2024-08-29 3425/week @ 2024-09-05 6185/week @ 2024-09-12 3601/week @ 2024-09-19 2685/week @ 2024-09-26 2889/week @ 2024-10-03 1971/week @ 2024-10-10 4972/week @ 2024-10-17 2710/week @ 2024-10-24 2280/week @ 2024-10-31 1437/week @ 2024-11-07 4982/week @ 2024-11-14 3114/week @ 2024-11-21 6798/week @ 2024-11-28 2695/week @ 2024-12-05

18,260 downloads per month
Used in 8 crates (via selinux)

MIT license

16KB
264 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 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.

No runtime deps