[−][src]Struct rustc_ap_syntax::token::Token
Fields
kind: TokenKindspan: SpanMethods
impl Token[src]
pub fn new(kind: TokenKind, span: Span) -> Self[src]
pub fn dummy() -> Self[src]
Some token that will be thrown away later.
pub fn from_ast_ident(ident: Ident) -> Self[src]
Recovers a Token from an ast::Ident. This creates a raw identifier if necessary.
pub fn take(&mut self) -> Self[src]
Return this token by value and leave a dummy token in its place.
pub fn is_op(&self) -> bool[src]
pub fn is_like_plus(&self) -> bool[src]
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 can_begin_const_arg(&self) -> bool[src]
Returns true if the token can appear at the start of a const param.
pub fn can_begin_bound(&self) -> bool[src]
Returns true if the token can appear at the start of a generic bound.
pub fn is_lit(&self) -> bool[src]
Returns true if the token is any literal
pub fn can_begin_literal_or_bool(&self) -> bool[src]
Returns true if the token is any literal, a minus (which can prefix a literal,
for example a '-42', or one of the boolean idents).
pub fn ident(&self) -> Option<(Ident, bool)>[src]
Returns an identifier if this token is an identifier.
pub fn lifetime(&self) -> Option<Ident>[src]
Returns a lifetime identifier if this token is a lifetime.
pub fn is_ident(&self) -> bool[src]
Returns true if the token is an identifier.
pub fn is_lifetime(&self) -> bool[src]
Returns true if the token is a lifetime.
pub fn is_ident_named(&self, name: Symbol) -> bool[src]
Returns true if the token is a identifier whose name is the given
string slice.
pub fn is_whole_expr(&self) -> bool[src]
Would maybe_whole_expr in parser.rs return Ok(..)?
That is, is this a pre-parsed expression dropped into the token stream
(which happens while parsing the result of macro expansion)?
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: Symbol) -> bool[src]
Returns true if the token is a given keyword, kw.
pub fn is_path_segment_keyword(&self) -> bool[src]
pub fn is_special_ident(&self) -> bool[src]
pub fn is_used_keyword(&self) -> bool[src]
Returns true if the token is a keyword used in the language.
pub fn is_unused_keyword(&self) -> bool[src]
Returns true if the token is a keyword reserved for possible future use.
pub fn is_reserved_ident(&self) -> bool[src]
Returns true if the token is either a special identifier or a keyword.
pub fn is_bool_lit(&self) -> bool[src]
Returns true if the token is the identifier true or false.
pub fn glue(&self, joint: &Token) -> Option<Token>[src]
Trait Implementations
impl Clone for Token[src]
impl PartialEq<Token> for Token[src]
impl PartialEq<TokenKind> for Token[src]
impl Debug for Token[src]
impl StructuralPartialEq for Token[src]
impl Encodable for Token[src]
impl Decodable for Token[src]
Auto Trait Implementations
impl !Send for Token
impl !Sync for Token
impl Unpin for Token
impl !UnwindSafe for Token
impl !RefUnwindSafe for Token
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Erased for T[src]
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized, [src]
T: UseSpecializedEncodable + ?Sized,
impl<T> Decodable for T where
T: UseSpecializedDecodable, [src]
T: UseSpecializedDecodable,