Skip to main content

AtomicOperations

Trait AtomicOperations 

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

Trait for operations on atomics.

Required Methods§

Source

fn new(value: T) -> Self

Source

fn load(&self, order: Ordering) -> T

Source

fn store(&self, value: T, order: Ordering)

Source

fn fetch_add(&self, value: T, order: Ordering) -> T

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AtomicOperations<i64> for AtomicI64

Source§

fn new(value: i64) -> Self

Source§

fn load(&self, order: Ordering) -> i64

Source§

fn store(&self, value: i64, order: Ordering)

Source§

fn fetch_add(&self, value: i64, order: Ordering) -> i64

Source§

impl AtomicOperations<u32> for AtomicU32

Source§

fn new(value: u32) -> Self

Source§

fn load(&self, order: Ordering) -> u32

Source§

fn store(&self, value: u32, order: Ordering)

Source§

fn fetch_add(&self, value: u32, order: Ordering) -> u32

Source§

impl AtomicOperations<u64> for AtomicU64

Source§

fn new(value: u64) -> Self

Source§

fn load(&self, order: Ordering) -> u64

Source§

fn store(&self, value: u64, order: Ordering)

Source§

fn fetch_add(&self, value: u64, order: Ordering) -> u64

Source§

impl AtomicOperations<usize> for AtomicUsize

Source§

fn new(value: usize) -> Self

Source§

fn load(&self, order: Ordering) -> usize

Source§

fn store(&self, value: usize, order: Ordering)

Source§

fn fetch_add(&self, value: usize, order: Ordering) -> usize

Implementors§