Struct raii_counter::WeakCounter [−][src]
pub struct WeakCounter(_);
A 'weak' Counter that does not affect the count.
Methods
impl WeakCounter
[src]
impl WeakCounter
pub fn new() -> WeakCounter
[src]
pub fn new() -> WeakCounter
pub fn count(&self) -> usize
[src]
pub fn count(&self) -> usize
This method is inherently racey. Assume the count will have changed once the value is observed.
pub fn upgrade(self) -> Counter
[src]
pub fn upgrade(self) -> Counter
Consumes self, becomes a Counter
pub fn spawn_upgrade(&self) -> Counter
[src]
pub fn spawn_upgrade(&self) -> Counter
Instead of clone + upgrade, this will only clone once Defaults to a Counter of size 1
pub fn spawn_upgrade_with_size(&self, size: usize) -> Counter
[src]
pub fn spawn_upgrade_with_size(&self, size: usize) -> Counter
Instead of clone + upgrade, this will only clone once
Trait Implementations
impl Clone for WeakCounter
[src]
impl Clone for WeakCounter
fn clone(&self) -> WeakCounter
[src]
fn clone(&self) -> WeakCounter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for WeakCounter
impl Send for WeakCounter
impl Sync for WeakCounter
impl Sync for WeakCounter