pub struct Tokenizer<'a> { /* private fields */ }
Implementations§
source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
pub fn new(input: &'a str) -> Tokenizer<'a>
pub fn step(&mut self) -> Result<Option<(Span, Token<'a>)>, Error>
pub fn peek(&mut self) -> Result<Option<(Span, Token<'a>)>, Error>
pub fn eat(&mut self, expected: Token<'a>) -> Result<bool, Error>
sourcepub fn eat_spanned(
&mut self,
expected: Token<'a>,
) -> Result<Option<Span>, Error>
pub fn eat_spanned( &mut self, expected: Token<'a>, ) -> Result<Option<Span>, Error>
Eat a value, returning it’s span if it was consumed.
pub fn expect(&mut self, expected: Token<'a>) -> Result<(), Error>
sourcepub fn expect_spanned(&mut self, expected: Token<'a>) -> Result<Span, Error>
pub fn expect_spanned(&mut self, expected: Token<'a>) -> Result<Span, Error>
Expect the given token returning its span.
pub fn table_key(&mut self) -> Result<Key<'a>, Error>
pub fn eat_whitespace(&mut self)
pub fn eat_comment(&mut self) -> Result<bool, Error>
pub fn eat_newline_or_eof(&mut self) -> Result<(), Error>
pub fn skip_to_newline(&mut self)
pub fn current(&mut self) -> usize
pub fn substr_offset(&self, s: &'a str) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tokenizer<'a>
impl<'a> RefUnwindSafe for Tokenizer<'a>
impl<'a> Send for Tokenizer<'a>
impl<'a> Sync for Tokenizer<'a>
impl<'a> Unpin for Tokenizer<'a>
impl<'a> UnwindSafe for Tokenizer<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)