pub struct SelfRefCell<T: PointerRecomposition, I: Offset = isize> { /* private fields */ }Expand description
Container that provides safe access to a self-referenced value.
Implementations§
Source§impl<T: PointerRecomposition, I: Offset + Nullable> SelfRefCell<T, I>
impl<T: PointerRecomposition, I: Offset + Nullable> SelfRefCell<T, I>
Sourcepub fn try_get(&self) -> Option<&T>
pub fn try_get(&self) -> Option<&T>
Immutable access to the value if the pointer has been initialised.
§Returns
Option<&T>- Shared reference when the pointer is ready.
Sourcepub fn try_get_mut(&mut self) -> Option<&mut T>
pub fn try_get_mut(&mut self) -> Option<&mut T>
Mutable access to the value if the pointer has been initialised.
§Returns
Option<&mut T>- Exclusive reference when the pointer is ready.
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Auto Trait Implementations§
impl<T, I> Freeze for SelfRefCell<T, I>
impl<T, I> RefUnwindSafe for SelfRefCell<T, I>
impl<T, I = isize> !Send for SelfRefCell<T, I>
impl<T, I = isize> !Sync for SelfRefCell<T, I>
impl<T, I> Unpin for SelfRefCell<T, I>
impl<T, I> UnwindSafe for SelfRefCell<T, I>where
T: UnwindSafe + RefUnwindSafe,
I: UnwindSafe,
<T as PointerRecomposition>::Components: 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