pub struct Symbol(/* private fields */);Expand description
A interned string in the global symbol table.
This requires the global feature on the crate.
GlobalSymbol is a wrapper around Symbol that knows to refer to a
built-in, global SymbolTable. Strings into the global table are never freed.
This enables a lot of convience methods and trait implementations over
GlobalSymbol (see below). In particular,
you can convert it to &'static str,
convert From and Into a &str,
and de/serialize using serde if the serde feature is enabled.
Implementations§
Trait Implementations§
Source§impl Clone for GlobalSymbol
impl Clone for GlobalSymbol
Source§fn clone(&self) -> GlobalSymbol
fn clone(&self) -> GlobalSymbol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GlobalSymbol
impl Debug for GlobalSymbol
Source§impl Display for GlobalSymbol
impl Display for GlobalSymbol
Source§impl From<&String> for GlobalSymbol
impl From<&String> for GlobalSymbol
Source§fn from(s: &String) -> GlobalSymbol
fn from(s: &String) -> GlobalSymbol
Converts to this type from the input type.
Source§impl From<&str> for GlobalSymbol
impl From<&str> for GlobalSymbol
Source§fn from(s: &str) -> GlobalSymbol
fn from(s: &str) -> GlobalSymbol
Converts to this type from the input type.
Source§impl From<GlobalSymbol> for &'static str
impl From<GlobalSymbol> for &'static str
Source§fn from(sym: GlobalSymbol) -> &'static str
fn from(sym: GlobalSymbol) -> &'static str
Converts to this type from the input type.
Source§impl From<String> for GlobalSymbol
impl From<String> for GlobalSymbol
Source§fn from(s: String) -> GlobalSymbol
fn from(s: String) -> GlobalSymbol
Converts to this type from the input type.
Source§impl FromStr for GlobalSymbol
impl FromStr for GlobalSymbol
Source§type Err = Infallible
type Err = Infallible
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<GlobalSymbol, <GlobalSymbol as FromStr>::Err>
fn from_str(s: &str) -> Result<GlobalSymbol, <GlobalSymbol as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for GlobalSymbol
impl Hash for GlobalSymbol
Source§impl LanguageChildren for Symbol
impl LanguageChildren for Symbol
fn all_slot_occurrences_iter_mut(&mut self) -> impl Iterator<Item = &mut Slot>
fn public_slot_occurrences_iter_mut( &mut self, ) -> impl Iterator<Item = &mut Slot>
fn applied_id_occurrences_iter_mut( &mut self, ) -> impl Iterator<Item = &mut AppliedId>
fn all_slot_occurrences_iter(&self) -> impl Iterator<Item = &Slot>
fn public_slot_occurrences_iter(&self) -> impl Iterator<Item = &Slot>
fn applied_id_occurrences_iter(&self) -> impl Iterator<Item = &AppliedId>
fn to_syntax(&self) -> Vec<SyntaxElem>
fn from_syntax(elems: &[SyntaxElem]) -> Option<Self>
fn weak_shape_impl(&mut self, _m: &mut (SlotMap, u32))
Source§impl Ord for GlobalSymbol
impl Ord for GlobalSymbol
Source§fn cmp(&self, other: &GlobalSymbol) -> Ordering
fn cmp(&self, other: &GlobalSymbol) -> Ordering
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 PartialEq for GlobalSymbol
impl PartialEq for GlobalSymbol
Source§fn eq(&self, other: &GlobalSymbol) -> bool
fn eq(&self, other: &GlobalSymbol) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GlobalSymbol
impl PartialOrd for GlobalSymbol
impl Copy for GlobalSymbol
impl Eq for GlobalSymbol
impl StructuralPartialEq for GlobalSymbol
Auto Trait Implementations§
impl Freeze for GlobalSymbol
impl RefUnwindSafe for GlobalSymbol
impl Send for GlobalSymbol
impl Sync for GlobalSymbol
impl Unpin for GlobalSymbol
impl UnsafeUnpin for GlobalSymbol
impl UnwindSafe for GlobalSymbol
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