Crate register_count
source ·Expand description
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