pub struct AnyRoot { /* private fields */ }Expand description
A type-erased root garbage collected reference.
Implementations§
Source§impl AnyRoot
impl AnyRoot
Sourcepub fn load<T>(&self) -> Option<&T>where
T: Collectable,
pub fn load<T>(&self) -> Option<&T>where
T: Collectable,
Loads a reference to the underlying data. Returns None if T is not
the type of the underlying data.
Sourcepub fn downcast_root<T>(&self) -> Option<Root<T>>where
T: Collectable,
pub fn downcast_root<T>(&self) -> Option<Root<T>>where
T: Collectable,
Returns a Root<T> if the underlying reference points to a T.
Sourcepub const fn downcast_ref<T>(&self) -> Ref<T>where
T: Collectable,
pub const fn downcast_ref<T>(&self) -> Ref<T>where
T: Collectable,
Returns a Ref<T>.
This function does not do any type checking. If T is not the correct
type, attempting to load the underyling value will fail.
Sourcepub fn downcast_checked<T>(&self) -> Option<Ref<T>>where
T: Collectable,
pub fn downcast_checked<T>(&self) -> Option<Ref<T>>where
T: Collectable,
Returns a Ref<T>, if T matches the type of this reference.
Trait Implementations§
Source§impl Ord for AnyRoot
impl Ord for AnyRoot
Source§impl PartialOrd for AnyRoot
impl PartialOrd for AnyRoot
impl Eq for AnyRoot
impl Send for AnyRoot
impl StructuralPartialEq for AnyRoot
impl Sync for AnyRoot
Auto Trait Implementations§
impl Freeze for AnyRoot
impl RefUnwindSafe for AnyRoot
impl Unpin for AnyRoot
impl UnwindSafe for AnyRoot
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