pub struct AnyRef { /* private fields */ }Expand description
A type-erased garbage collected reference.
Implementations§
source§impl AnyRef
impl AnyRef
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>.
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_root<T>(&self, guard: &CollectionGuard<'_>) -> Option<Root<T>>where
T: Collectable,
pub fn downcast_root<T>(&self, guard: &CollectionGuard<'_>) -> Option<Root<T>>where
T: Collectable,
Returns a Root<T> if the underlying reference points to a T that
has not been collected.
sourcepub fn load<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>
) -> Option<&'guard T>where
T: Collectable,
pub fn load<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>
) -> Option<&'guard T>where
T: Collectable,
Loads a reference to the underlying data. Returns None if the data has
been collected and is no longer available.
sourcepub fn load_mapped<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>
) -> Option<&'guard T>where
T: ?Sized + 'static,
pub fn load_mapped<'guard, T>(
&self,
guard: &'guard CollectionGuard<'_>
) -> Option<&'guard T>where
T: ?Sized + 'static,
Returns a reference to the result of MapAs::map_as(), if the value
has not been collected and MapAs::Target is T.
Trait Implementations§
source§impl Ord for AnyRef
impl Ord for AnyRef
source§impl<T> PartialEq<&AnyRef> for Ref<T>where
T: Collectable,
impl<T> PartialEq<&AnyRef> for Ref<T>where
T: Collectable,
source§impl<T> PartialEq<&AnyRef> for Root<T>where
T: Collectable,
impl<T> PartialEq<&AnyRef> for Root<T>where
T: Collectable,
source§impl<T> PartialEq<AnyRef> for Ref<T>where
T: Collectable,
impl<T> PartialEq<AnyRef> for Ref<T>where
T: Collectable,
source§impl<T> PartialEq<AnyRef> for Root<T>where
T: Collectable,
impl<T> PartialEq<AnyRef> for Root<T>where
T: Collectable,
source§impl PartialEq for AnyRef
impl PartialEq for AnyRef
source§impl PartialOrd for AnyRef
impl PartialOrd for AnyRef
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for AnyRef
impl Eq for AnyRef
impl StructuralPartialEq for AnyRef
Auto Trait Implementations§
impl Freeze for AnyRef
impl RefUnwindSafe for AnyRef
impl Send for AnyRef
impl Sync for AnyRef
impl Unpin for AnyRef
impl UnwindSafe for AnyRef
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