pub struct Atomic<T: Well>(/* private fields */);Expand description
Atomic potential well.
Internally, this just wraps a pointer to <T as Deref>::Target and uses atomic pointer
operations to access it. However, the number of operations on the pointer is limited to
ensure correctness in safe code.
Implementations§
Source§impl<T: Well> Atomic<T>
impl<T: Well> Atomic<T>
Sourcepub unsafe fn as_raw_unchecked(&self) -> &AtomicPtr<<T as Deref>::Target>
pub unsafe fn as_raw_unchecked(&self) -> &AtomicPtr<<T as Deref>::Target>
Gives access to the underlying AtomicPtr.
§Safety
The pointer inside the atomic must always a valid pointer from Well::remove and
therefore must not be null. Additionally, keep in mind that this atomic owns the
pointer, and if you want to move it out, you must put a different pointer in its place
first.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Atomic<T>
impl<T> RefUnwindSafe for Atomic<T>
impl<T> Send for Atomic<T>
impl<T> Sync for Atomic<T>
impl<T> Unpin for Atomic<T>
impl<T> UnsafeUnpin for Atomic<T>
impl<T> UnwindSafe for Atomic<T>
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