pub struct PotentialAtomic<T, W: PotentialWell>(/* private fields */);Expand description
Type-hoisted Atomic.
Uses PotentialWell to allow for recursive structures at the cost of some usability.
See the documentation for PotentialWell for more information.
Implementations§
Source§impl<T, W: PotentialWell> PotentialAtomic<T, W>
impl<T, W: PotentialWell> PotentialAtomic<T, W>
Sourcepub fn new(well: W::Well<T>) -> PotentialAtomic<T, W>
pub fn new(well: W::Well<T>) -> PotentialAtomic<T, W>
Creates atomic with a value.
Sourcepub unsafe fn as_raw_unchecked(&self) -> &AtomicPtr<T>
pub unsafe fn as_raw_unchecked(&self) -> &AtomicPtr<T>
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.
Source§impl<T, W: PotentialWell<Well<T>: StrongWell + Deref<Target = T>>> PotentialAtomic<T, W>
impl<T, W: PotentialWell<Well<T>: StrongWell + Deref<Target = T>>> PotentialAtomic<T, W>
Source§impl<T: Unpin, W: PotentialWell<Well<T>: StrongWellMut + Deref<Target = T>>> PotentialAtomic<T, W>
impl<T: Unpin, W: PotentialWell<Well<T>: StrongWellMut + Deref<Target = T>>> PotentialAtomic<T, W>
Source§impl<T, W: PotentialWell<Well<T>: StrongWellMut + Deref<Target = T>>> PotentialAtomic<T, Pin<W>>
impl<T, W: PotentialWell<Well<T>: StrongWellMut + Deref<Target = T>>> PotentialAtomic<T, Pin<W>>
Sourcepub fn load_mut_pinned(&mut self) -> Pin<&mut T>
pub fn load_mut_pinned(&mut self) -> Pin<&mut T>
Loads the inner data as a mutable reference.
This is a version of load_mut that works with pinned values.
Source§impl<T, W: PotentialWell<Well<T>: Clone>> PotentialAtomic<T, W>
impl<T, W: PotentialWell<Well<T>: Clone>> PotentialAtomic<T, W>
Sourcepub fn load_clone(&self, ordering: Ordering) -> W::Well<T>
pub fn load_clone(&self, ordering: Ordering) -> W::Well<T>
Loads a clone of the inner data.
This still performs an atomic load, but instead of offering a reference, the smart
pointer is cloned instead.
Trait Implementations§
Source§impl<T, W: PotentialWell<Well<T>: Debug>> Debug for PotentialAtomic<T, W>
impl<T, W: PotentialWell<Well<T>: Debug>> Debug for PotentialAtomic<T, W>
Auto Trait Implementations§
impl<T, W> !Freeze for PotentialAtomic<T, W>
impl<T, W> RefUnwindSafe for PotentialAtomic<T, W>
impl<T, W> Send for PotentialAtomic<T, W>
impl<T, W> Sync for PotentialAtomic<T, W>
impl<T, W> Unpin for PotentialAtomic<T, W>
impl<T, W> UnsafeUnpin for PotentialAtomic<T, W>
impl<T, W> UnwindSafe for PotentialAtomic<T, W>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