vm_memory

Trait AtomicInteger

Source
pub unsafe trait AtomicInteger: Sync + Send {
    type V;

    // Required methods
    fn new(v: Self::V) -> Self;
    fn load(&self, order: Ordering) -> Self::V;
    fn store(&self, val: Self::V, order: Ordering);
}
Expand description

§Safety

Objects that implement this trait must consist exclusively of atomic types from std::sync::atomic, except for AtomicPtr<T> and AtomicBool.

Required Associated Types§

Source

type V

The raw value type associated with the atomic integer (i.e. u16 for AtomicU16).

Required Methods§

Source

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

Create a new instance of Self.

Source

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

Loads a value from the atomic integer.

Source

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

Stores a value into the atomic integer.

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 AtomicInteger for AtomicI8

Source§

type V = i8

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicI16

Source§

type V = i16

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicI32

Source§

type V = i32

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicI64

Source§

type V = i64

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicIsize

Source§

type V = isize

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicU8

Source§

type V = u8

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicU16

Source§

type V = u16

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicU32

Source§

type V = u32

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicU64

Source§

type V = u64

Source§

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

Source§

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

Source§

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

Source§

impl AtomicInteger for AtomicUsize

Source§

type V = usize

Source§

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

Source§

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

Source§

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

Implementors§