1 unstable release
0.1.0 | Jan 31, 2023 |
---|
#1808 in Asynchronous
410 downloads per month
Used in 4 crates
(3 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