#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 3519/week @ 2024-09-21 2450/week @ 2024-09-28 3074/week @ 2024-10-05 2552/week @ 2024-10-12 4800/week @ 2024-10-19 2379/week @ 2024-10-26 1681/week @ 2024-11-02 1913/week @ 2024-11-09 4976/week @ 2024-11-16 3810/week @ 2024-11-23 6187/week @ 2024-11-30 3052/week @ 2024-12-07 4562/week @ 2024-12-14 3675/week @ 2024-12-21 6098/week @ 2024-12-28 4889/week @ 2025-01-04

19,510 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