#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

#73 in FFI

Download history 5188/week @ 2024-02-21 4016/week @ 2024-02-28 4729/week @ 2024-03-06 4978/week @ 2024-03-13 4558/week @ 2024-03-20 4988/week @ 2024-03-27 3658/week @ 2024-04-03 4759/week @ 2024-04-10 3829/week @ 2024-04-17 4948/week @ 2024-04-24 6349/week @ 2024-05-01 3090/week @ 2024-05-08 4015/week @ 2024-05-15 3322/week @ 2024-05-22 2816/week @ 2024-05-29 1449/week @ 2024-06-05

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