[−][src]Struct generic_lexer::Token
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
Auto Trait Implementations
impl<K> RefUnwindSafe for Token<K> where
K: RefUnwindSafe,
K: RefUnwindSafe,
impl<K> Send for Token<K> where
K: Send,
K: Send,
impl<K> Sync for Token<K> where
K: Sync,
K: Sync,
impl<K> Unpin for Token<K> where
K: Unpin,
K: Unpin,
impl<K> UnwindSafe for Token<K> where
K: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,