#counter #register

no-std register-count

Counting Registers created by a Counter

1 unstable release

0.1.0 Jan 31, 2023

#1770 in Asynchronous

Download history 263/week @ 2024-02-25 221/week @ 2024-03-03 133/week @ 2024-03-10 187/week @ 2024-03-17 1148/week @ 2024-03-24 457/week @ 2024-03-31 994/week @ 2024-04-07 203/week @ 2024-04-14 239/week @ 2024-04-21 270/week @ 2024-04-28 209/week @ 2024-05-05 166/week @ 2024-05-12 234/week @ 2024-05-19 133/week @ 2024-05-26 124/week @ 2024-06-02 96/week @ 2024-06-09

607 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