pub struct Symbol(/* private fields */);Expand description
Compact handle returned by Interner::intern.
A Symbol is a 4-byte Copy value. Within a single interner, two
symbols compare equal if and only if the strings they refer to were
interned from byte-identical inputs.
Symbols are scoped to the Interner that issued them: id values
collide across separate interners (both start at 0, etc.). Passing a
foreign symbol to Interner::resolve is undefined at the API
contract level — the call may return None, or it may return an
unrelated string. Treat Symbol values as opaque handles tied to a
single interner.
Implementations§
Trait Implementations§
Source§impl Ord for Symbol
impl Ord for Symbol
1.21.0 (const: unstable) · 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 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 UnsafeUnpin 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