Essentially an AtomicUsize that is clonable and whose count is based on the number of copies. The count is automatically updated on Drop.
pub fn new_with_size(size: usize) -> Counter[src]
pub fn downgrade(self) -> WeakCounter[src]
Consume self (causing the count to decrease by 1) and return a weak reference to the count through a WeakCounter
This method is inherently racey. Assume the count will have changed once the value is observed.
pub async fn wait_for_empty<'_>(&'_ self)[src]
Returns a future that waits until the counter contains a 0 value
impl !RefUnwindSafe for Counter
impl !UnwindSafe for Counter
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.