AtomicNative

Trait AtomicNative 

Source
pub trait AtomicNative:
    Sized
    + Default
    + Debug {
    type Atomic: From<Self>;

    // Required methods
    fn load(atomic: &Self::Atomic) -> Self;
    fn store(atomic: &Self::Atomic, val: Self);
    fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self;
    fn get_mut(atomic: &mut Self::Atomic) -> &mut Self;
}

Required Associated Types§

Source

type Atomic: From<Self>

Required Methods§

Source

fn load(atomic: &Self::Atomic) -> Self

Source

fn store(atomic: &Self::Atomic, val: Self)

Source

fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self

Source

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

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 AtomicNative for bool

Source§

type Atomic = AtomicBool

Source§

fn load(atomic: &Self::Atomic) -> Self

Source§

fn store(atomic: &Self::Atomic, val: Self)

Source§

fn fetch_add(_atomic: &Self::Atomic, _val: Self) -> Self

Source§

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

Source§

impl AtomicNative for u8

Source§

type Atomic = AtomicU8

Source§

fn load(atomic: &Self::Atomic) -> Self

Source§

fn store(atomic: &Self::Atomic, val: Self)

Source§

fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self

Source§

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

Source§

impl AtomicNative for u32

Source§

type Atomic = AtomicU32

Source§

fn load(atomic: &Self::Atomic) -> Self

Source§

fn store(atomic: &Self::Atomic, val: Self)

Source§

fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self

Source§

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

Source§

impl AtomicNative for u64

Source§

type Atomic = AtomicU64

Source§

fn load(atomic: &Self::Atomic) -> Self

Source§

fn store(atomic: &Self::Atomic, val: Self)

Source§

fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self

Source§

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

Source§

impl AtomicNative for usize

Source§

type Atomic = AtomicUsize

Source§

fn load(atomic: &Self::Atomic) -> Self

Source§

fn store(atomic: &Self::Atomic, val: Self)

Source§

fn fetch_add(atomic: &Self::Atomic, val: Self) -> Self

Source§

fn get_mut(atomic: &mut Self::Atomic) -> &mut Self

Implementors§