Skip to main content

AtomicCell

Trait AtomicCell 

Source
pub trait AtomicCell<T>: Sync {
    // Required methods
    fn new(value: T) -> Self;
    fn load(&self) -> T;
    fn store(&self, value: T);
}
Expand description

Atomic cell abstraction over a pair of f64 values (seqlock-backed).

Implemented by AtomicComplex and AtomicVec2 so the atomic policy can be generic over the state element type.

Required Methods§

Source

fn new(value: T) -> Self

Create a cell initialized with value.

Source

fn load(&self) -> T

Torn-free read of the current value.

Source

fn store(&self, value: T)

Store a new value; single-writer per slot.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§