[][src]Struct generic_lexer::Token

pub struct Token<K> { /* fields omitted */ }

A token with a kind (usually an enum representing distinct token types) and its source text

Methods

impl<K> Token<K>[src]

pub fn new(kind: K, text: String) -> Token<K>[src]

Create a new token with the given kind and text

pub fn kind(&self) -> &K[src]

Return the token's kind (usually an enum)

pub fn text(&self) -> &String[src]

Return the token's text

pub fn into_text(self) -> String[src]

Trait Implementations

impl<K: Debug> Debug for Token<K>[src]

Auto Trait Implementations

impl<K> RefUnwindSafe for Token<K> where
    K: RefUnwindSafe

impl<K> Send for Token<K> where
    K: Send

impl<K> Sync for Token<K> where
    K: Sync

impl<K> Unpin for Token<K> where
    K: Unpin

impl<K> UnwindSafe for Token<K> where
    K: UnwindSafe

Blanket Implementations

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

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

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

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.