Struct raii_counter::Counter[][src]

pub struct Counter { /* fields omitted */ }

Essentially an AtomicUsize that is clonable and whose count is based on the number of copies. The count is automatically updated on Drop.

Methods

impl Counter
[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.

Trait Implementations

impl Clone for Counter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Drop for Counter
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl Send for Counter

impl Sync for Counter