Enum public_api::tokens::Token
source · pub enum Token {
}Expand description
A token in a rendered PublicItem, used to apply syntax colouring in downstream applications.
Variants§
Symbol(String)
A symbol, like = or ::<
Qualifier(String)
A qualifier, like pub or const
Kind(String)
The kind of an item, like function or trait
Whitespace
Whitespace, a single space
Identifier(String)
An identifier, like variable names or parts of the path of an item
Annotation(String)
An annotation, used e.g. for Rust attributes.
Self_(String)
The identifier self, the text can be self or Self
Function(String)
The identifier for a function, like fn_arg in comprehensive_api::functions::fn_arg
Lifetime(String)
A lifetime including the apostrophe ', like 'a
Keyword(String)
A keyword, like impl, where, or dyn
Generic(String)
A generic parameter, like T
Primitive(String)
A primitive type, like usize
Type(String)
A non-primitive type, like the name of a struct or a trait
Implementations§
Trait Implementations§
source§impl Ord for Token
impl Ord for Token
source§impl PartialEq<Token> for Token
impl PartialEq<Token> 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