1 unstable release
0.1.0 | Jan 31, 2023 |
---|
#1260 in Asynchronous
2,073 downloads per month
Used in 8 crates
(6 directly)
4KB
register-count
Counting Register
s created by a Counter
Usage
This crate helps you to count the number of currently un-dropped Register
s 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