pub struct Symbol(/* private fields */);Expand description
An interned Rex identifier.
Create symbols with Symbol::intern. Two Symbols compare by interned
identity, so equality is a pointer check rather than repeated string
comparison. The interner guarantees that all live symbols with the same text
share one allocation.
Hashing, ordering, and borrowed lookup remain text-shaped, so Symbol works
naturally as a map key. Comparing a Symbol with an &str is also supported
as a convenience textual comparison.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Symbol
impl<'de> Deserialize<'de> for Symbol
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 Eq 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