Struct jsonc_parser::Scanner
source · pub struct Scanner<'a> { /* private fields */ }
Expand description
Converts text into a stream of tokens.
Implementations§
source§impl<'a> Scanner<'a>
impl<'a> Scanner<'a>
sourcepub fn new(file_text: &'a str) -> Scanner<'a>
pub fn new(file_text: &'a str) -> Scanner<'a>
Creates a new scanner based on the provided text.
pub fn file_text(&self) -> &str
sourcepub fn scan(&mut self) -> Result<Option<Token<'a>>, ParseError>
pub fn scan(&mut self) -> Result<Option<Token<'a>>, ParseError>
Moves to and returns the next token.
sourcepub fn token_start(&self) -> usize
pub fn token_start(&self) -> usize
Gets the start position of the token.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Scanner<'a>
impl<'a> Send for Scanner<'a>
impl<'a> Sync for Scanner<'a>
impl<'a> Unpin for Scanner<'a>
impl<'a> UnwindSafe for Scanner<'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