[][src]Trait atomig::impls::AtomicImpl

pub trait AtomicImpl: Sized + Sealed {
    type Inner: PrimitiveAtom<Impl = Self>;
    fn new(v: Self::Inner) -> Self;
fn get_mut(&mut self) -> &mut Self::Inner;
fn into_inner(self) -> Self::Inner;
fn load(&self, order: Ordering) -> Self::Inner;
fn store(&self, v: Self::Inner, order: Ordering);
fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner;
fn compare_and_swap(
        &self,
        current: Self::Inner,
        new: Self::Inner,
        order: Ordering
    ) -> Self::Inner;
fn compare_exchange(
        &self,
        current: Self::Inner,
        new: Self::Inner,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Inner, Self::Inner>;
fn compare_exchange_weak(
        &self,
        current: Self::Inner,
        new: Self::Inner,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Inner, Self::Inner>; }

Common interface of all atomic types in std::sync::atomic.

This trait is exactly implemented for all atomic types in std::sync::atomic and you cannot and should not implement this trait for your own types. Instead of using these methods directly, use Atomic which has the same interface.

Associated Types

type Inner: PrimitiveAtom<Impl = Self>

Loading content...

Required methods

fn new(v: Self::Inner) -> Self

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

fn into_inner(self) -> Self::Inner

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

fn store(&self, v: Self::Inner, order: Ordering)

fn swap(&self, v: Self::Inner, order: Ordering) -> Self::Inner

fn compare_and_swap(
    &self,
    current: Self::Inner,
    new: Self::Inner,
    order: Ordering
) -> Self::Inner

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

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

Loading content...

Implementations on Foreign Types

impl<T> AtomicImpl for AtomicPtr<T>[src]

type Inner = *mut T

impl AtomicImpl for AtomicBool[src]

type Inner = bool

impl AtomicImpl for AtomicU8[src]

type Inner = u8

impl AtomicImpl for AtomicI8[src]

type Inner = i8

impl AtomicImpl for AtomicU16[src]

type Inner = u16

impl AtomicImpl for AtomicI16[src]

type Inner = i16

impl AtomicImpl for AtomicU32[src]

type Inner = u32

impl AtomicImpl for AtomicI32[src]

type Inner = i32

impl AtomicImpl for AtomicU64[src]

type Inner = u64

impl AtomicImpl for AtomicI64[src]

type Inner = i64

impl AtomicImpl for AtomicUsize[src]

type Inner = usize

impl AtomicImpl for AtomicIsize[src]

type Inner = isize

Loading content...

Implementors

Loading content...