AtomicOperations

Trait AtomicOperations 

Source
pub trait AtomicOperations {
    // Required methods
    unsafe fn atomic_store(dst: *mut Self, val: Self);
    unsafe fn atomic_load(dst: *const Self) -> Self;
    unsafe fn atomic_add(dst: *mut Self, val: Self);
    unsafe fn atomic_sub(dst: *mut Self, val: Self);
    unsafe fn atomic_and(dst: *mut Self, val: Self);
    unsafe fn atomic_clear(dst: *mut Self, val: Self);
    unsafe fn atomic_or(dst: *mut Self, val: Self);
    unsafe fn atomic_xor(dst: *mut Self, val: Self);
}
Expand description

Atomic arithmetic and bitwise operations implemented for numerical types. Each operation is implemented with a single assembly instruction.

Required Methods§

Source

unsafe fn atomic_store(dst: *mut Self, val: Self)

Store value into destination pointee.

Source

unsafe fn atomic_load(dst: *const Self) -> Self

Read value from destination pointee.

Source

unsafe fn atomic_add(dst: *mut Self, val: Self)

Add value to destination pointee. Result may wrap around.

Source

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Subtract value from destination pointee. Result may wrap around.

Source

unsafe fn atomic_and(dst: *mut Self, val: Self)

Clear all bits in destination pointee that are zeroed in value.

Source

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Clear all bits in destination pointee that are set in value

Source

unsafe fn atomic_or(dst: *mut Self, val: Self)

Set all bits in destination pointee that are set in value.

Source

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Toggle all bits in destination pointee that are set in value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AtomicOperations for i8

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Source§

impl AtomicOperations for i16

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Source§

impl AtomicOperations for isize

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Source§

impl AtomicOperations for u8

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Source§

impl AtomicOperations for u16

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Source§

impl AtomicOperations for usize

Source§

unsafe fn atomic_store(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_load(dst: *const Self) -> Self

Source§

unsafe fn atomic_add(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_sub(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_and(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_clear(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_or(dst: *mut Self, val: Self)

Source§

unsafe fn atomic_xor(dst: *mut Self, val: Self)

Implementors§