[][src]Enum syntex_syntax2::parse::token::Token

pub enum Token {
    Eq,
    Lt,
    Le,
    EqEq,
    Ne,
    Ge,
    Gt,
    AndAnd,
    OrOr,
    Not,
    Tilde,
    BinOp(BinOpToken),
    BinOpEq(BinOpToken),
    At,
    Dot,
    DotDot,
    DotDotDot,
    Comma,
    Semi,
    Colon,
    ModSep,
    RArrow,
    LArrow,
    FatArrow,
    Pound,
    Dollar,
    Question,
    OpenDelim(DelimToken),
    CloseDelim(DelimToken),
    Literal(LitOption<Name>),
    Ident(Ident),
    Underscore,
    Lifetime(Ident),
    Interpolated(Rc<Nonterminal>),
    DocComment(Name),
    SubstNt(Ident),
    Whitespace,
    Comment,
    Shebang(Name),
    Eof,
}

Variants

EqLtLeEqEqNeGeGtAndAndOrOrNotTildeBinOp(BinOpToken)BinOpEq(BinOpToken)AtDotDotDotDotDotDotCommaSemiColonModSepRArrowLArrowFatArrowPoundDollarQuestionOpenDelim(DelimToken)

An opening delimiter, eg. {

CloseDelim(DelimToken)

A closing delimiter, eg. }

Literal(LitOption<Name>)Ident(Ident)UnderscoreLifetime(Ident)Interpolated(Rc<Nonterminal>)DocComment(Name)

Doc comment

SubstNt(Ident)

A syntactic variable that will be filled in by macro expansion.

Whitespace

Whitespace

Comment

Comment

Shebang(Name)Eof

Methods

impl Token[src]

pub fn is_like_gt(&self) -> bool[src]

Returns true if the token starts with '>'.

pub fn can_begin_expr(&self) -> bool[src]

Returns true if the token can appear at the start of an expression.

pub fn can_begin_type(&self) -> bool[src]

Returns true if the token can appear at the start of a type.

pub fn is_lit(&self) -> bool[src]

Returns true if the token is any literal

pub fn ident(&self) -> Option<Ident>[src]

pub fn is_ident(&self) -> bool[src]

Returns true if the token is an identifier.

pub fn is_doc_comment(&self) -> bool[src]

Returns true if the token is a documentation comment.

pub fn is_interpolated(&self) -> bool[src]

Returns true if the token is interpolated.

pub fn is_path(&self) -> bool[src]

Returns true if the token is an interpolated path.

pub fn is_lifetime(&self) -> bool[src]

Returns true if the token is a lifetime.

pub fn is_mutability(&self) -> bool[src]

Returns true if the token is either the mut or const keyword.

pub fn is_qpath_start(&self) -> bool[src]

pub fn is_path_start(&self) -> bool[src]

pub fn is_keyword(&self, kw: Keyword) -> bool[src]

Returns true if the token is a given keyword, kw.

pub fn is_path_segment_keyword(&self) -> bool[src]

pub fn is_any_keyword(&self) -> bool[src]

Returns true if the token is either a strict or reserved keyword.

pub fn is_strict_keyword(&self) -> bool[src]

Returns true if the token is a strict keyword.

pub fn is_reserved_keyword(&self) -> bool[src]

Returns true if the token is a keyword reserved for possible future use.

Trait Implementations

impl PartialEq<Token> for Token[src]

impl Eq for Token[src]

impl From<Token> for TokenStream[src]

impl Clone for Token[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Hash for Token[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Token[src]

impl<'de> Deserialize<'de> for Token[src]

impl Serialize for Token[src]

Auto Trait Implementations

impl !Send for Token

impl Unpin for Token

impl !Sync for Token

impl !UnwindSafe for Token

impl !RefUnwindSafe for Token

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]