pub struct ArenaRc<T: ?Sized>(/* private fields */);
Expand description
An equivalent to ArenaBox
that holds onto a reference to the
arena to allow it to have static lifetime, and implements Clone
allowing it to be shared. Since it’s shared, you can’t get a mutable
reference to it back without using Self::try_unwrap
to get the
inner ArenaStaticBox
.
Implementations§
Source§impl<T: ?Sized> ArenaRc<T>
impl<T: ?Sized> ArenaRc<T>
Sourcepub unsafe fn new_unchecked(arena: Arena, data: ArenaBox<'_, T>) -> ArenaRc<T>
pub unsafe fn new_unchecked(arena: Arena, data: ArenaBox<'_, T>) -> ArenaRc<T>
Sourcepub fn try_unwrap(this: Self) -> Result<ArenaStaticBox<T>, Self>
pub fn try_unwrap(this: Self) -> Result<ArenaStaticBox<T>, Self>
Trait Implementations§
Source§impl<T: ?Sized> From<ArenaStaticBox<T>> for ArenaRc<T>
impl<T: ?Sized> From<ArenaStaticBox<T>> for ArenaRc<T>
Source§fn from(value: ArenaStaticBox<T>) -> Self
fn from(value: ArenaStaticBox<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for ArenaRc<T>where
T: ?Sized,
impl<T> RefUnwindSafe for ArenaRc<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for ArenaRc<T>
impl<T> Sync for ArenaRc<T>
impl<T> Unpin for ArenaRc<T>where
T: ?Sized,
impl<T> UnwindSafe for ArenaRc<T>where
T: RefUnwindSafe + ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)