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

reference-counted-singleton

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

5 releases

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

#71 in FFI

Download history 4515/week @ 2024-03-14 4534/week @ 2024-03-21 5045/week @ 2024-03-28 3833/week @ 2024-04-04 4709/week @ 2024-04-11 4055/week @ 2024-04-18 5475/week @ 2024-04-25 5723/week @ 2024-05-02 3136/week @ 2024-05-09 3564/week @ 2024-05-16 3210/week @ 2024-05-23 3033/week @ 2024-05-30 1329/week @ 2024-06-06 2515/week @ 2024-06-13 2831/week @ 2024-06-20 4425/week @ 2024-06-27

11,544 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