#counter #register

no-std register-count

Counting Registers created by a Counter

1 unstable release

0.1.0 Jan 31, 2023

#1569 in Asynchronous

Download history 584/week @ 2024-11-15 457/week @ 2024-11-22 522/week @ 2024-11-29 345/week @ 2024-12-06 338/week @ 2024-12-13 643/week @ 2024-12-20 363/week @ 2024-12-27 371/week @ 2025-01-03 411/week @ 2025-01-10 660/week @ 2025-01-17 855/week @ 2025-01-24 374/week @ 2025-01-31 860/week @ 2025-02-07 633/week @ 2025-02-14 344/week @ 2025-02-21 293/week @ 2025-02-28

2,234 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