#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

#63 in FFI

Download history 3114/week @ 2024-11-21 6783/week @ 2024-11-28 3103/week @ 2024-12-05 3487/week @ 2024-12-12 4234/week @ 2024-12-19 6232/week @ 2024-12-26 5332/week @ 2025-01-02 6931/week @ 2025-01-09 6028/week @ 2025-01-16 4653/week @ 2025-01-23 6490/week @ 2025-01-30 1876/week @ 2025-02-06 698/week @ 2025-02-13 600/week @ 2025-02-20 454/week @ 2025-02-27 322/week @ 2025-03-06

2,286 downloads per month

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