pub struct WeakCounter { /* private fields */ }
Expand description
A ‘weak’ Counter
that does not affect the count.
Implementations§
Source§impl WeakCounter
impl WeakCounter
Sourcepub fn builder() -> WeakCounterBuilder
pub fn builder() -> WeakCounterBuilder
Create a new default WeakCounterBuilder
.
Sourcepub fn count(&self) -> usize
pub fn count(&self) -> usize
This method is inherently racey. Assume the count will have changed once the value is observed.
Sourcepub fn spawn_upgrade(&self) -> Counter
pub fn spawn_upgrade(&self) -> Counter
Create a new Counter
with size
1 without consuming the
current WeakCounter
.
Sourcepub fn spawn_upgrade_with_size(&self, size: usize) -> Counter
pub fn spawn_upgrade_with_size(&self, size: usize) -> Counter
Creates a new Counter
with specified size without consuming the
current WeakCounter
.
Trait Implementations§
Source§impl Clone for WeakCounter
impl Clone for WeakCounter
Source§fn clone(&self) -> WeakCounter
fn clone(&self) -> WeakCounter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WeakCounter
impl Debug for WeakCounter
Auto Trait Implementations§
impl Freeze for WeakCounter
impl RefUnwindSafe for WeakCounter
impl Send for WeakCounter
impl Sync for WeakCounter
impl Unpin for WeakCounter
impl UnwindSafe for WeakCounter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more