pub struct Symbol<'a, T: 'a> { /* private fields */ }
Expand description
A symbol from an interner.
Can be used to resolve to the associated instance.
Implementations§
source§impl<T> Symbol<'_, T>
impl<T> Symbol<'_, T>
sourcepub fn into_untracked(self) -> UntrackedSymbol<T>
pub fn into_untracked(self) -> UntrackedSymbol<T>
Removes the lifetime tracking for this symbol.
§Note
- This can be useful in situations where a data structure owns all symbols and interners and can verify accesses by itself.
- For further safety reasons an untracked symbol can no longer be used to resolve from an interner. It is still useful for serialization purposes.
§Safety
Although removing lifetime constraints this operation can be considered to be safe since untracked symbols can no longer be used to resolve their associated instance from the interner.
Trait Implementations§
source§impl<'a, T: Ord + 'a> Ord for Symbol<'a, T>
impl<'a, T: Ord + 'a> Ord for Symbol<'a, T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a, T: PartialOrd + 'a> PartialOrd for Symbol<'a, T>
impl<'a, T: PartialOrd + 'a> PartialOrd for Symbol<'a, T>
impl<'a, T: Copy + 'a> Copy for Symbol<'a, T>
impl<'a, T: Eq + 'a> Eq for Symbol<'a, T>
impl<'a, T: 'a> StructuralPartialEq for Symbol<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Symbol<'a, T>
impl<'a, T> RefUnwindSafe for Symbol<'a, T>
impl<'a, T> Send for Symbol<'a, T>
impl<'a, T> Sync for Symbol<'a, T>
impl<'a, T> Unpin for Symbol<'a, T>
impl<'a, T> UnwindSafe for Symbol<'a, T>
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
)