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