#counter #register

no-std register-count

Counting Registers created by a Counter

1 unstable release

0.1.0 Jan 31, 2023

#1808 in Asynchronous

Download history 124/week @ 2024-03-14 922/week @ 2024-03-21 551/week @ 2024-03-28 802/week @ 2024-04-04 567/week @ 2024-04-11 237/week @ 2024-04-18 265/week @ 2024-04-25 228/week @ 2024-05-02 168/week @ 2024-05-09 218/week @ 2024-05-16 144/week @ 2024-05-23 148/week @ 2024-05-30 87/week @ 2024-06-06 110/week @ 2024-06-13 115/week @ 2024-06-20 70/week @ 2024-06-27

410 downloads per month
Used in 4 crates (3 directly)

MIT license

4KB

register-count

Counting Registers created by a Counter

Version Documentation License

Usage

This crate helps you to count the number of currently un-dropped Registers created by a Counter.

use register_count::Counter;

let cnt = Counter::new();
println!("Number of registers: {}", cnt.count()); // 0
let reg1 = cnt.reg();
println!("Number of registers: {}", cnt.count()); // 1
let reg2 = reg1.clone();
println!("Number of registers: {}", cnt.count()); // 2
drop(reg1);
println!("Number of registers: {}", cnt.count()); // 1

no_std

Opt-out of the default features to use this crate in no_std environments.

License

MIT License

No runtime deps

Features