Struct atomic_counter::ConsistentCounter[][src]

pub struct ConsistentCounter(_);

Implementation of AtomicCounter that uses Sequentially Consistent memory ordering.

See crate level documentation for more details.

Note that all operations wrap if the counter is incremented beyond usize::max_value().

Methods

impl ConsistentCounter
[src]

Creates a new counter with initial_value

Trait Implementations

impl Debug for ConsistentCounter
[src]

Formats the value using the given formatter. Read more

impl Default for ConsistentCounter
[src]

Returns the "default value" for a type. Read more

impl AtomicCounter for ConsistentCounter
[src]

Underlying primitive type that is being shared atomically.

Atomically increments the counter by one, returning the previous value.

Atomically increments the counter by amount, returning the previous value.

Atomically gets the current value of the counter, without modifying the counter.

Atomically returns the current value of the counter, while resetting to count to zero.

Consume the atomic counter and return the primitive type. Read more

Auto Trait Implementations