pub struct AtomicPtr<T>(/* private fields */);Expand description
Mock implementation of std::sync::atomic::AtomicPtr or portable_atomic::AtomicPtr.
Implementations§
Source§impl<T> AtomicPtr<T>
impl<T> AtomicPtr<T>
Sourcepub fn into_inner(self) -> *mut T
pub fn into_inner(self) -> *mut T
Consumes the atomic and returns the contained value.
Sourcepub fn swap(&self, val: *mut T, order: Ordering) -> *mut T
pub fn swap(&self, val: *mut T, order: Ordering) -> *mut T
Stores a value into the pointer, returning the previous value.
Sourcepub fn compare_exchange(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T>
pub fn compare_exchange( &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.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for AtomicPtr<T>
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> UnsafeUnpin for AtomicPtr<T>
impl<T> UnwindSafe for AtomicPtr<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more