MmapAtomicI16

Struct MmapAtomicI16 

Source
pub struct MmapAtomicI16 { /* private fields */ }
Expand description

Atomic wrapper for memory-mapped structs

Implementations§

Source§

impl MmapAtomicI16

Source

pub fn new(value: i16) -> Self

Source

pub fn get(&self) -> i16

Load value with default SeqCst ordering

Source

pub fn set(&self, value: i16)

Store value with default SeqCst ordering

Source

pub fn add(&self, value: i16) -> i16

Add to value with default SeqCst ordering

Source

pub fn sub(&self, value: i16) -> i16

Subtract from value with default SeqCst ordering

Source

pub fn inc(&self) -> i16

Increment by 1 with default SeqCst ordering

Source

pub fn dec(&self) -> i16

Decrement by 1 with default SeqCst ordering

Source

pub fn load(&self, ordering: Ordering) -> i16

Source

pub fn store(&self, value: i16, ordering: Ordering)

Source

pub fn fetch_add(&self, value: i16, ordering: Ordering) -> i16

Source

pub fn fetch_sub(&self, value: i16, ordering: Ordering) -> i16

Source

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

Compare and exchange values

§Errors

Returns Err with the actual value if it doesn’t match current

Source

pub fn swap(&self, value: i16, ordering: Ordering) -> i16

Source

pub fn fetch_max(&self, value: i16, ordering: Ordering) -> i16

Source

pub fn fetch_min(&self, value: i16, ordering: Ordering) -> i16

Trait Implementations§

Source§

impl Default for MmapAtomicI16

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.