#[repr(C)]
pub struct AtomicMaybeUninit<T: Primitive> { /* private fields */ }
Expand description

A potentially uninitialized integer type which can be safely shared between threads.

This type has the same in-memory representation as the underlying integer type, T.

Implementations

Creates a new atomic integer.

This is const fn on Rust 1.61+. See also const_new function.

Returns a mutable reference to the underlying integer.

This is safe because the mutable reference guarantees that no other threads are concurrently accessing the atomic data.

Consumes the atomic and returns the contained value.

This is safe because passing self by value guarantees that no other threads are concurrently accessing the atomic data.

Loads a value from the atomic integer.

load takes an Ordering argument which describes the memory ordering of this operation. Possible values are SeqCst, Acquire and Relaxed.

Panics

Panics if order is Release or AcqRel.

Stores a value into the atomic integer.

store takes an Ordering argument which describes the memory ordering of this operation. Possible values are SeqCst, Release and Relaxed.

Panics

Panics if order is Acquire or AcqRel.

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

swap takes an Ordering argument which describes the memory ordering of this operation. All ordering modes are possible. Note that using Acquire makes the store part of this operation Relaxed, and using Release makes the load part Relaxed.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Creates a new atomic integer. Unlike new, this is always const fn.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

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.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.