pub enum Symbol {
T(TokenId),
NT(VarId),
Empty,
End,
}Variants§
Implementations§
Source§impl Symbol
impl Symbol
pub fn is_end(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_t(&self) -> bool
pub fn is_nt(&self) -> bool
pub fn to_str<T: SymInfoTable>(&self, symbol_table: Option<&T>) -> String
Sourcepub fn to_str_quote<T: SymInfoTable>(&self, symbol_table: Option<&T>) -> String
pub fn to_str_quote<T: SymInfoTable>(&self, symbol_table: Option<&T>) -> String
Converts the symbol to string, using the symbol table if available, and surrounding it with quotes if it’s a string literal.
pub fn to_str_name<T: SymInfoTable>(&self, symbol_table: Option<&T>) -> String
Sourcepub fn to_str_ext<T: SymInfoTable>(
&self,
symbol_table: Option<&T>,
ext: &String,
) -> String
pub fn to_str_ext<T: SymInfoTable>( &self, symbol_table: Option<&T>, ext: &String, ) -> String
Converts the symbol to string, using the symbol table if available.
Sourcepub fn to_macro_item(&self) -> String
pub fn to_macro_item(&self) -> String
Converts to symbols used in sym! and other related macros.
Trait Implementations§
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