pub enum TokOpt {
Some(String, String),
None(String),
}Expand description
This is an enum for representing tokens.
Variants§
Some(String, String)
The Some variant represents a token being present in the format Some(TEXT, NAME).
So for a comment token, you can expect to see Some(“/* comment */”, “comment”) provided that you defined the comment using either the keyword or bounded function on Highlighter
None(String)
The None variant represents just plain text.
Implementations§
Source§impl TokOpt
impl TokOpt
Sourcepub fn nibble_front(&mut self, tab_width: usize) -> Option<char>
pub fn nibble_front(&mut self, tab_width: usize) -> Option<char>
This will remove the first character from the end of this token
Sourcepub fn nibble_back(&mut self, tab_width: usize) -> Option<char>
pub fn nibble_back(&mut self, tab_width: usize) -> Option<char>
This will remove the last character from the end of this token
pub fn skip(&mut self, idx: usize, tab_width: usize)
pub fn take(&mut self, idx: usize, tab_width: usize)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokOpt
impl RefUnwindSafe for TokOpt
impl Send for TokOpt
impl Sync for TokOpt
impl Unpin for TokOpt
impl UnwindSafe for TokOpt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more