Struct scale_info::interner::Symbol
source · [−]pub struct Symbol<'a, T> { /* private fields */ }
Expand description
A symbol from an interner.
Can be used to resolve to the associated instance.
Implementations
sourceimpl<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
sourceimpl<'a, T: Ord> Ord for Symbol<'a, T>
impl<'a, T: Ord> Ord for Symbol<'a, T>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a, T: PartialEq> PartialEq<Symbol<'a, T>> for Symbol<'a, T>
impl<'a, T: PartialEq> PartialEq<Symbol<'a, T>> for Symbol<'a, T>
sourceimpl<'a, T: PartialOrd> PartialOrd<Symbol<'a, T>> for Symbol<'a, T>
impl<'a, T: PartialOrd> PartialOrd<Symbol<'a, T>> for Symbol<'a, T>
sourcefn partial_cmp(&self, other: &Symbol<'a, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Symbol<'a, T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<'a, T: Copy> Copy for Symbol<'a, T>
impl<'a, T: Eq> Eq for Symbol<'a, T>
impl<'a, T> StructuralEq for Symbol<'a, T>
impl<'a, T> StructuralPartialEq for Symbol<'a, T>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more