#counter #register

no-std register-count

Counting Registers created by a Counter

1 unstable release

0.1.0 Jan 31, 2023

#1553 in Asynchronous

Download history 945/week @ 2023-12-22 257/week @ 2023-12-29 229/week @ 2024-01-05 170/week @ 2024-01-12 200/week @ 2024-01-19 251/week @ 2024-01-26 190/week @ 2024-02-02 213/week @ 2024-02-09 268/week @ 2024-02-16 246/week @ 2024-02-23 242/week @ 2024-03-01 156/week @ 2024-03-08 114/week @ 2024-03-15 1172/week @ 2024-03-22 471/week @ 2024-03-29 869/week @ 2024-04-05

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