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

reference-counted-singleton

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

5 releases

new 0.1.4 Mar 27, 2024
0.1.3 Jan 8, 2024
0.1.2 Sep 3, 2022
0.1.1 Jul 29, 2021
0.1.0 Jun 9, 2021

#68 in FFI

Download history 2265/week @ 2023-12-07 2164/week @ 2023-12-14 3081/week @ 2023-12-21 1888/week @ 2023-12-28 3375/week @ 2024-01-04 4346/week @ 2024-01-11 3480/week @ 2024-01-18 5095/week @ 2024-01-25 4472/week @ 2024-02-01 3651/week @ 2024-02-08 3330/week @ 2024-02-15 5409/week @ 2024-02-22 4034/week @ 2024-02-29 4932/week @ 2024-03-07 4515/week @ 2024-03-14 4082/week @ 2024-03-21

18,264 downloads per month
Used in 7 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