[−][src]Struct loom::sync::atomic::AtomicUsize
Mock implementation of std::sync::atomic::$name
.
Methods
impl AtomicUsize
[src]
pub fn new(v: usize) -> Self
[src]
Creates a new instance of $name
.
pub fn get_mut(&mut self) -> &mut usize
[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) -> usize
[src]
Load the value without any synchronization.
pub fn load(&self, order: Ordering) -> usize
[src]
Loads a value from the atomic integer.
pub fn store(&self, val: usize, order: Ordering)
[src]
Stores a value into the atomic integer.
pub fn swap(&self, val: usize, order: Ordering) -> usize
[src]
Stores a value into the atomic integer, returning the previous value.
pub fn compare_and_swap(
&self,
current: usize,
new: usize,
order: Ordering
) -> usize
[src]
&self,
current: usize,
new: usize,
order: Ordering
) -> usize
Stores a value into the atomic integer if the current value is the same as the current
value.
pub fn compare_exchange(
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
[src]
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
Stores a value into the atomic if the current value is the same as the current
value.
pub fn compare_exchange_weak(
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
[src]
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
Stores a value into the atomic if the current value is the same as the current value.
pub fn fetch_add(&self, val: usize, order: Ordering) -> usize
[src]
Adds to the current value, returning the previous value.
pub fn fetch_sub(&self, val: usize, order: Ordering) -> usize
[src]
Subtracts from the current value, returning the previous value.
pub fn fetch_and(&self, val: usize, order: Ordering) -> usize
[src]
Bitwise "and" with the current value.
pub fn fetch_or(&self, val: usize, order: Ordering) -> usize
[src]
Bitwise "or" with the current value.
pub fn fetch_xor(&self, val: usize, order: Ordering) -> usize
[src]
Bitwise "xor" with the current value.
Trait Implementations
Auto Trait Implementations
impl Send for AtomicUsize
impl Sync for AtomicUsize
impl Unpin for AtomicUsize
impl UnwindSafe for AtomicUsize
impl RefUnwindSafe for AtomicUsize
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,