#reference-counting #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

#68 in FFI

Download history 4920/week @ 2024-01-24 4636/week @ 2024-01-31 3854/week @ 2024-02-07 3165/week @ 2024-02-14 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 2531/week @ 2024-05-08

18,071 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