pub struct Symbol(/* private fields */);Expand description
Default unique identifier for a string in an Interner.
Implementations§
Source§impl Symbol
impl Symbol
Sourcepub fn from_usize(id: usize) -> Self
pub fn from_usize(id: usize) -> Self
Sourcepub fn try_from_usize(id: usize) -> Option<Self>
pub fn try_from_usize(id: usize) -> Option<Self>
Tries to create a new Symbol from a usize.
Sourcepub unsafe fn new_unchecked(id: u32) -> Self
pub unsafe fn new_unchecked(id: u32) -> Self
Creates a new Symbol from a u32 without checking if it is valid.
§Safety
The caller must ensure that id is less than u32::MAX.
Trait Implementations§
Source§impl InternerSymbol for Symbol
impl InternerSymbol for Symbol
Source§impl Ord for Symbol
impl Ord for Symbol
Source§impl PartialOrd for Symbol
impl PartialOrd for Symbol
impl Copy for Symbol
impl Eq for Symbol
impl StructuralPartialEq for Symbol
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more