pub struct SymbolRef(/* private fields */);Expand description
A garbage-collected weak reference to a Symbol.
Implementations§
source§impl SymbolRef
impl SymbolRef
sourcepub fn load<'guard>(
&self,
guard: &'guard CollectionGuard<'_>,
) -> Option<&'guard str>
pub fn load<'guard>( &self, guard: &'guard CollectionGuard<'_>, ) -> Option<&'guard str>
Loads the underlying string value of this symbol.
Returns None if the underlying symbol has been freed by the garbage
collector.
sourcepub fn try_load<'guard>(
&self,
guard: &'guard CollectionGuard<'_>,
) -> Result<&'guard str, ValueFreed>
pub fn try_load<'guard>( &self, guard: &'guard CollectionGuard<'_>, ) -> Result<&'guard str, ValueFreed>
Tries to loads the underlying string value of this symbol.
§Errors
Returns ValueFreed if the underlying symbol has been freed by the
garbage collector.
sourcepub fn upgrade(&self, guard: &CollectionGuard<'_>) -> Option<Symbol>
pub fn upgrade(&self, guard: &CollectionGuard<'_>) -> Option<Symbol>
Upgrades this weak reference to a reference-counted Symbol.
Returns None if the underlying symbol has been freed by the garbage
collector.
sourcepub fn try_upgrade(
&self,
guard: &CollectionGuard<'_>,
) -> Result<Symbol, ValueFreed>
pub fn try_upgrade( &self, guard: &CollectionGuard<'_>, ) -> Result<Symbol, ValueFreed>
Tries to upgrade this weak reference to a reference-counted Symbol.
§Errors
Returns ValueFreed if the underlying symbol has been freed by the
garbage collector.
Trait Implementations§
source§impl<'a> From<&'a StaticSymbol> for SymbolRef
impl<'a> From<&'a StaticSymbol> for SymbolRef
source§fn from(value: &'a StaticSymbol) -> Self
fn from(value: &'a StaticSymbol) -> Self
Converts to this type from the input type.
source§impl Ord for SymbolRef
impl Ord for SymbolRef
source§impl PartialOrd for SymbolRef
impl PartialOrd for SymbolRef
impl Copy for SymbolRef
impl Eq for SymbolRef
impl StructuralPartialEq for SymbolRef
Auto Trait Implementations§
impl Freeze for SymbolRef
impl RefUnwindSafe for SymbolRef
impl Send for SymbolRef
impl Sync for SymbolRef
impl Unpin for SymbolRef
impl UnwindSafe for SymbolRef
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)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more