pub struct AtomicRefBox<T> { /* private fields */ }Expand description
A thread-safe pointer type that uniquely owns a heap allocation of type T, but allows immutable (weak) references to be created and shared.
CRITICAL: The current implementation is flawed. See Deref implementation for reason.
Implementations§
Source§impl<T> AtomicRefBox<T>
impl<T> AtomicRefBox<T>
pub fn new(value: T) -> AtomicRefBox<T>
Sourcepub fn borrow_mut(this: &Self) -> AtomicMutRef<'_, T>
pub fn borrow_mut(this: &Self) -> AtomicMutRef<'_, T>
Mutably borrows the inner value.
pub fn to_weak(this: &Self) -> AtomicWeakRef<T>
Sourcepub fn into_inner(this: Self) -> T
pub fn into_inner(this: Self) -> T
Extracts the inner value from the box.
This function may block until all weak references have finished actively borrowing the value.
Trait Implementations§
Source§impl<T> AsRef<T> for AtomicRefBox<T>
impl<T> AsRef<T> for AtomicRefBox<T>
Auto Trait Implementations§
impl<T> Freeze for AtomicRefBox<T>
impl<T> RefUnwindSafe for AtomicRefBox<T>
impl<T> Send for AtomicRefBox<T>
impl<T> Sync for AtomicRefBox<T>
impl<T> Unpin for AtomicRefBox<T>
impl<T> UnwindSafe for AtomicRefBox<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