[−][src]Struct loom::sync::atomic::AtomicU32
Mock implementation of std::sync::atomic::$name
.
Methods
impl AtomicU32
[src]
pub fn new(v: u32) -> Self
[src]
Creates a new instance of $name
.
pub fn with_mut<R>(&mut self, f: impl FnOnce(&mut u32) -> R) -> R
[src]
Get access to a mutable reference to the inner value.
pub unsafe fn unsync_load(&self) -> u32
[src]
Load the value without any synchronization.
pub fn load(&self, order: Ordering) -> u32
[src]
Loads a value from the atomic integer.
pub fn store(&self, val: u32, order: Ordering)
[src]
Stores a value into the atomic integer.
pub fn swap(&self, val: u32, order: Ordering) -> u32
[src]
Stores a value into the atomic integer, returning the previous value.
pub fn compare_and_swap(&self, current: u32, new: u32, order: Ordering) -> u32
[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: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
[src]
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
Stores a value into the atomic if the current value is the same as the current
value.
pub fn compare_exchange_weak(
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
[src]
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
Stores a value into the atomic if the current value is the same as the current value.
pub fn fetch_add(&self, val: u32, order: Ordering) -> u32
[src]
Adds to the current value, returning the previous value.
pub fn fetch_sub(&self, val: u32, order: Ordering) -> u32
[src]
Subtracts from the current value, returning the previous value.
pub fn fetch_and(&self, val: u32, order: Ordering) -> u32
[src]
Bitwise "and" with the current value.
pub fn fetch_or(&self, val: u32, order: Ordering) -> u32
[src]
Bitwise "or" with the current value.
pub fn fetch_xor(&self, val: u32, order: Ordering) -> u32
[src]
Bitwise "xor" with the current value.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AtomicU32
impl Send for AtomicU32
impl Sync for AtomicU32
impl Unpin for AtomicU32
impl UnwindSafe for AtomicU32
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,