#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

#67 in FFI

Download history 2176/week @ 2024-10-11 5054/week @ 2024-10-18 2504/week @ 2024-10-25 2033/week @ 2024-11-01 1692/week @ 2024-11-08 5019/week @ 2024-11-15 3292/week @ 2024-11-22 6481/week @ 2024-11-29 3218/week @ 2024-12-06 4036/week @ 2024-12-13 4097/week @ 2024-12-20 5848/week @ 2024-12-27 5512/week @ 2025-01-03 6880/week @ 2025-01-10 6244/week @ 2025-01-17 3811/week @ 2025-01-24

22,908 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