pub struct Rooted<T: CustomType + Trace>(/* private fields */);Expand description
A reference counted pointer to a garbage collected value.
Implementations§
source§impl<T> Rooted<T>where
T: CustomType + Trace,
impl<T> Rooted<T>where
T: CustomType + Trace,
sourcepub fn new<'guard>(
value: T,
guard: &impl AsRef<CollectionGuard<'guard>>,
) -> Self
pub fn new<'guard>( value: T, guard: &impl AsRef<CollectionGuard<'guard>>, ) -> Self
Moves value into the garbage collector and returns a rooted reference
to it.
sourcepub const fn as_any_dynamic(&self) -> AnyDynamic
pub const fn as_any_dynamic(&self) -> AnyDynamic
Returns a weak, typeless reference to this value.
sourcepub fn as_any_root(&self) -> AnyDynamicRoot
pub fn as_any_root(&self) -> AnyDynamicRoot
Returns this value as a typeless root reference.
sourcepub fn into_any_root(self) -> AnyDynamicRoot
pub fn into_any_root(self) -> AnyDynamicRoot
Returns this value as a typeless root reference.
Trait Implementations§
source§impl<T: CustomType + Trace> AsRef<T> for Rooted<T>
impl<T: CustomType + Trace> AsRef<T> for Rooted<T>
source§impl<T: CustomType + Trace> Clone for Rooted<T>
impl<T: CustomType + Trace> Clone for Rooted<T>
source§impl<T: CustomType + Trace> Deref for Rooted<T>
impl<T: CustomType + Trace> Deref for Rooted<T>
source§impl<T> Trace for Rooted<T>where
T: CustomType + Trace,
impl<T> Trace for Rooted<T>where
T: CustomType + Trace,
Auto Trait Implementations§
impl<T> Freeze for Rooted<T>
impl<T> RefUnwindSafe for Rooted<T>where
T: RefUnwindSafe,
impl<T> Send for Rooted<T>
impl<T> Sync for Rooted<T>
impl<T> Unpin for Rooted<T>
impl<T> UnwindSafe for Rooted<T>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
§impl<A> Cast for A
impl<A> Cast for A
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)