pub struct Token { /* private fields */ }
Implementations§
source§impl Token
impl Token
pub fn new(token_type: TokenType, span: Span) -> Token
pub fn token_type(&self) -> &TokenType
pub fn span(&self) -> &Span
pub fn is_colon(&self) -> bool
pub fn is_equ(&self) -> bool
pub fn has_name(&self, name: &str) -> bool
pub fn name_starts_with(&self, starts: &str) -> bool
pub fn macro_label_starts_with(&self, starts: &str) -> bool
pub fn has_macro_name(&self, name: &str) -> bool
pub fn get_name(&self) -> Option<&str>
pub fn is_name(&self) -> bool
pub fn is_string(&self) -> bool
pub fn name_matching(&self, pred: fn(_: &str) -> bool) -> bool
pub fn is_eof(&self) -> bool
pub fn is_hash(&self) -> bool
pub fn is_macro_ident(&self) -> bool
pub fn is_local_label_name(&self) -> bool
pub fn is_local_macro_label(&self) -> bool
pub fn is_macro_label(&self) -> bool
pub fn is_indirection_mode(&self) -> bool
Trait Implementations§
source§impl Ord for Token
impl Ord for Token
source§impl PartialOrd<Token> for Token
impl PartialOrd<Token> for Token
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more