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

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§