[−][src]Struct loom::sync::atomic::AtomicU8
Mock implementation of std::sync::atomic::$name
.
Methods
impl AtomicU8
[src]
pub fn new(v: u8) -> Self
[src]
Creates a new instance of $name
.
pub fn get_mut(&mut self) -> &mut u8
[src]
Returns a mutable reference to the underlying integer.
Panics
This function panics if the access is invalid under the Rust memory model.
pub unsafe fn unsync_load(&self) -> u8
[src]
Load the value without any synchronization.
pub fn load(&self, order: Ordering) -> u8
[src]
Loads a value from the atomic integer.
pub fn store(&self, val: u8, order: Ordering)
[src]
Stores a value into the atomic integer.
pub fn swap(&self, val: u8, order: Ordering) -> u8
[src]
Stores a value into the atomic integer, returning the previous value.
pub fn compare_and_swap(&self, current: u8, new: u8, order: Ordering) -> u8
[src]
Stores a value into the atomic integer if the current value is the same as the current
value.
pub fn compare_exchange(
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
[src]
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
Stores a value into the atomic if the current value is the same as the current
value.
pub fn compare_exchange_weak(
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
[src]
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
Stores a value into the atomic if the current value is the same as the current value.
pub fn fetch_add(&self, val: u8, order: Ordering) -> u8
[src]
Adds to the current value, returning the previous value.
pub fn fetch_sub(&self, val: u8, order: Ordering) -> u8
[src]
Subtracts from the current value, returning the previous value.
pub fn fetch_and(&self, val: u8, order: Ordering) -> u8
[src]
Bitwise "and" with the current value.
pub fn fetch_or(&self, val: u8, order: Ordering) -> u8
[src]
Bitwise "or" with the current value.
pub fn fetch_xor(&self, val: u8, order: Ordering) -> u8
[src]
Bitwise "xor" with the current value.
Trait Implementations
Auto Trait Implementations
impl Send for AtomicU8
impl Sync for AtomicU8
impl Unpin for AtomicU8
impl UnwindSafe for AtomicU8
impl RefUnwindSafe for AtomicU8
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,