pub unsafe trait Atomic: Send + Sync {
    type Primitive: HasAtomic<Atomic = Self>;

    fn new(v: Self::Primitive) -> Self;
    fn get_mut(&mut self) -> &mut Self::Primitive;
    fn into_inner(self) -> Self::Primitive;
    fn load(&self, order: Ordering) -> Self::Primitive;
    fn store(&self, val: Self::Primitive, order: Ordering);
    fn swap(&self, val: Self::Primitive, order: Ordering) -> Self::Primitive;
    fn compare_exchange(
        &self,
        current: Self::Primitive,
        new: Self::Primitive,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Primitive, Self::Primitive>; fn compare_exchange_weak(
        &self,
        current: Self::Primitive,
        new: Self::Primitive,
        success: Ordering,
        failure: Ordering
    ) -> Result<Self::Primitive, Self::Primitive>; fn fetch_update<F: FnMut(Self::Primitive) -> Option<Self::Primitive>>(
        &self,
        set_order: Ordering,
        fetch_ordering: Ordering,
        f: F
    ) -> Result<Self::Primitive, Self::Primitive>; }
Expand description

Safety

  • Self must have the same size and alignment as Primitive

Required Associated Types

Required Methods

Implementations on Foreign Types

Implementors