Struct actix_net::counter::Counter [−][src]
pub struct Counter(_);
Simple counter with ability to notify task on reaching specific number
Counter could be cloned, total ncount is shared across all clones.
Methods
impl Counter[src]
impl Counterpub fn new(capacity: usize) -> Self[src]
pub fn new(capacity: usize) -> SelfCreate Counter instance and set max value.
pub fn get(&self) -> CounterGuard[src]
pub fn get(&self) -> CounterGuardpub fn available(&self) -> bool[src]
pub fn available(&self) -> boolCheck if counter is not at capacity
pub fn total(&self) -> usize[src]
pub fn total(&self) -> usizeGet total number of acquired counts