Struct elemental::parselet_utils::Token
source · [−]pub struct Token { /* private fields */ }Expand description
Holds a token’s class and its value.
Implementations
sourceimpl Token
impl Token
sourcepub fn new(class: TokenClass, value: String) -> Self
pub fn new(class: TokenClass, value: String) -> Self
Constructs a new Token from a value and a TokenClass.
sourcepub fn get_class(&self) -> TokenClass
pub fn get_class(&self) -> TokenClass
Gets the class of the token.
sourcepub fn check(&self, class: TokenClass) -> bool
pub fn check(&self, class: TokenClass) -> bool
Checks if the token is in the given class.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more