[][src]Trait atomic_prim_traits::AtomicInt

pub trait AtomicInt: Default + Send + Sync + RefUnwindSafe + UnwindSafe {
    type Prim: Sized + Eq + Ord;
    fn new(val: Self::Prim) -> Self;
fn fetch_add(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn fetch_sub(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn fetch_and(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn fetch_nand(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn fetch_or(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn fetch_xor(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim;
fn get_mut(&mut self) -> &mut Self::Prim;
fn into_inner(self) -> Self::Prim;
fn load(&self, order: Ordering) -> Self::Prim;
fn store(&self, val: Self::Prim, order: Ordering);
fn swap(&self, val: Self::Prim, order: Ordering) -> Self::Prim;
fn compare_and_swap(
        &self,
        current: Self::Prim,
        new: Self::Prim,
        ordering: Ordering
    ) -> Self::Prim;
fn compare_exchange(
        &self,
        current: Self::Prim,
        new: Self::Prim,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Prim, Self::Prim>;
fn compare_exchange_weak(
        &self,
        current: Self::Prim,
        new: Self::Prim,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Prim, Self::Prim>; }

Associated Types

type Prim: Sized + Eq + Ord

Loading content...

Required methods

fn new(val: Self::Prim) -> Self

fn fetch_add(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn fetch_sub(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn fetch_and(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn fetch_nand(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn fetch_or(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn fetch_xor(&self, new: Self::Prim, ordering: Ordering) -> Self::Prim

fn get_mut(&mut self) -> &mut Self::Prim

fn into_inner(self) -> Self::Prim

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

fn store(&self, val: Self::Prim, order: Ordering)

fn swap(&self, val: Self::Prim, order: Ordering) -> Self::Prim

fn compare_and_swap(
    &self,
    current: Self::Prim,
    new: Self::Prim,
    ordering: Ordering
) -> Self::Prim

fn compare_exchange(
    &self,
    current: Self::Prim,
    new: Self::Prim,
    success: Ordering,
    failure: Ordering
) -> Result<Self::Prim, Self::Prim>

fn compare_exchange_weak(
    &self,
    current: Self::Prim,
    new: Self::Prim,
    success: Ordering,
    failure: Ordering
) -> Result<Self::Prim, Self::Prim>

Loading content...

Implementations on Foreign Types

impl AtomicInt for AtomicU8[src]

type Prim = u8

impl AtomicInt for AtomicU16[src]

type Prim = u16

impl AtomicInt for AtomicU32[src]

type Prim = u32

impl AtomicInt for AtomicU64[src]

type Prim = u64

impl AtomicInt for AtomicUsize[src]

type Prim = usize

Loading content...

Implementors

Loading content...