#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

#66 in FFI

Download history 4179/week @ 2024-07-05 2414/week @ 2024-07-12 4111/week @ 2024-07-19 2886/week @ 2024-07-26 2863/week @ 2024-08-02 3146/week @ 2024-08-09 2626/week @ 2024-08-16 1450/week @ 2024-08-23 1961/week @ 2024-08-30 3110/week @ 2024-09-06 6248/week @ 2024-09-13 3661/week @ 2024-09-20 2752/week @ 2024-09-27 2792/week @ 2024-10-04 2176/week @ 2024-10-11 4418/week @ 2024-10-18

12,484 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