Trait syncbox::atomic::Atomic [] [src]

pub trait Atomic<T>: Send + Sync {
    fn new(val: T) -> Self;
    fn load(&self, order: Ordering) -> T;
    fn store(&self, val: T, order: Ordering);
    fn swap(&self, val: T, order: Ordering) -> T;
    fn compare_and_swap(&self, old: T, new: T, order: Ordering) -> T;
}

An atomic box

Required Methods

Returns a new atomic box

Atomically loads the value from the box with the given ordering

Atomically stores the value from the box with the given ordering

Atomically swaps the value in the box with the given ordering

Swaps the value in the box if and only if the existing value is equal to old.

Implementors