[−][src]Struct loom::sync::atomic::AtomicPtr
Mock implementation of std::sync::atomic::AtomicPtr.
Methods
impl<T> AtomicPtr<T>[src]
pub fn new(v: *mut T) -> AtomicPtr<T>[src]
Creates a new instance of AtomicPtr.
pub unsafe fn unsync_load(&self) -> *mut T[src]
Load the value without any synchronization.
pub fn with_mut<R>(&mut self, f: impl FnOnce(&mut *mut T) -> R) -> R[src]
Get access to a mutable reference to the inner value.
pub fn load(&self, order: Ordering) -> *mut T[src]
Loads a value from the pointer.
pub fn store(&self, val: *mut T, order: Ordering)[src]
Stores a value into the pointer.
pub fn swap(&self, val: *mut T, order: Ordering) -> *mut T[src]
Stores a value into the pointer, returning the previous value.
pub fn compare_and_swap(
&self,
current: *mut T,
new: *mut T,
order: Ordering
) -> *mut T[src]
&self,
current: *mut T,
new: *mut T,
order: Ordering
) -> *mut T
Stores a value into the pointer if the current value is the same as the current value.
pub fn compare_exchange(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>[src]
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>
Stores a value into the pointer if the current value is the same as the current value.
pub fn compare_exchange_weak(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>[src]
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>
Stores a value into the atomic if the current value is the same as the current value.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for AtomicPtr<T>
impl<T> Send for AtomicPtr<T>
impl<T> Sync for AtomicPtr<T>
impl<T> Unpin for AtomicPtr<T>
impl<T> UnwindSafe for AtomicPtr<T>
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>,