#counter #register

no-std register-count

Counting Registers created by a Counter

1 unstable release

0.1.0 Jan 31, 2023

#1260 in Asynchronous

Download history 200/week @ 2024-07-25 308/week @ 2024-08-01 252/week @ 2024-08-08 662/week @ 2024-08-15 554/week @ 2024-08-22 594/week @ 2024-08-29 591/week @ 2024-09-05 322/week @ 2024-09-12 395/week @ 2024-09-19 455/week @ 2024-09-26 408/week @ 2024-10-03 544/week @ 2024-10-10 413/week @ 2024-10-17 400/week @ 2024-10-24 755/week @ 2024-10-31 441/week @ 2024-11-07

2,073 downloads per month
Used in 8 crates (6 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