pub struct Removed<T: Send + Sync + 'static> { /* private fields */ }Expand description
A value removed from an Atom or AtomOption.
The value can be read via Deref. When this wrapper is dropped,
T’s destructor is deferred through the reclamation system —
it will only run once all concurrent readers have moved on.
This prevents use-after-free when concurrent readers hold an
AtomGuard that references the same value’s internal heap
allocations (e.g. a String’s buffer or Vec’s backing array).
To take ownership without deferral (e.g. when you know no readers
exist), use into_inner_unchecked.
Implementations§
Trait Implementations§
impl<T: Send + Sync + 'static> Send for Removed<T>
impl<T: Send + Sync + 'static> Sync for Removed<T>
Auto Trait Implementations§
impl<T> Freeze for Removed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Removed<T>where
T: RefUnwindSafe,
impl<T> Unpin for Removed<T>where
T: Unpin,
impl<T> UnsafeUnpin for Removed<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Removed<T>where
T: UnwindSafe,
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