Trait vm_memory::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AtomicInteger for AtomicI8

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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§