pub struct TokenScanner<'a> { /* private fields */ }Expand description
Scanner for different token types
Implementations§
Source§impl<'a> TokenScanner<'a>
impl<'a> TokenScanner<'a>
Sourcepub fn new(source: &'a str, position: usize, line: usize, column: usize) -> Self
pub fn new(source: &'a str, position: usize, line: usize, column: usize) -> Self
Create new token scanner
Get current navigator state (mutable)
Get current navigator state (immutable)
Sourcepub fn scan_section_header(&mut self) -> Result<TokenType>
pub fn scan_section_header(&mut self) -> Result<TokenType>
Sourcepub fn scan_style_override(&mut self) -> Result<TokenType>
pub fn scan_style_override(&mut self) -> Result<TokenType>
Sourcepub fn scan_comment(&mut self) -> Result<TokenType>
pub fn scan_comment(&mut self) -> Result<TokenType>
Sourcepub fn scan_text(&mut self, context: TokenContext) -> Result<TokenType>
pub fn scan_text(&mut self, context: TokenContext) -> Result<TokenType>
Sourcepub fn scan_field_value(&mut self) -> Result<TokenType>
pub fn scan_field_value(&mut self) -> Result<TokenType>
Scan field value content in field value context
In field value context, colons are not delimiters (for time formats) and we consume until comma, newline, or end of input.
§Errors
Returns an error if character navigation fails.
Trait Implementations§
Source§impl<'a> Clone for TokenScanner<'a>
impl<'a> Clone for TokenScanner<'a>
Source§fn clone(&self) -> TokenScanner<'a>
fn clone(&self) -> TokenScanner<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for TokenScanner<'a>
impl<'a> RefUnwindSafe for TokenScanner<'a>
impl<'a> Send for TokenScanner<'a>
impl<'a> Sync for TokenScanner<'a>
impl<'a> Unpin for TokenScanner<'a>
impl<'a> UnwindSafe for TokenScanner<'a>
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