Struct loom::sync::atomic::AtomicU16[][src]

pub struct AtomicU16(_);
Expand description

Mock implementation of std::sync::atomic::AtomicU16.

Implementations

Creates a new instance of AtomicU16.

Get access to a mutable reference to the inner value.

Load the value without any synchronization.

Safety

An unsynchronized atomic load technically always has undefined behavior. However, if the atomic value is not currently visible by other threads, this should always be equivalent to a non-atomic load of an un-shared integer value.

Loads a value from the atomic integer.

Stores a value into the atomic integer.

Stores a value into the atomic integer, returning the previous value.

Stores a value into the atomic integer if the current value is the same as the current value.

Stores a value into the atomic if the current value is the same as the current value.

Stores a value into the atomic if the current value is the same as the current value.

Adds to the current value, returning the previous value.

Subtracts from the current value, returning the previous value.

Bitwise “and” with the current value.

Bitwise “nand” with the current value.

Bitwise “or” with the current value.

Bitwise “xor” with the current value.

Stores the maximum of the current and provided value, returning the previous value

Stores the minimum of the current and provided value, returning the previous value

Fetches the value, and applies a function to it that returns an optional new value. Returns a Result of Ok(previous_value) if the function returned Some(_), else Err(previous_value).

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more