pub struct ParseState<'a> { /* private fields */ }
Expand description
A wrapper around a &’a str which keeps track of the current index into the source string. Provides a mechanism for determining source locations during the parse.
Implementations§
Source§impl<'a> ParseState<'a>
impl<'a> ParseState<'a>
pub fn new(s: &'a str) -> ParseState<'a>
pub fn rest(self) -> &'a str
pub fn is_empty(self) -> bool
pub fn len(self) -> usize
pub fn starts_with(self, p: &str) -> bool
pub fn until(self, i: usize) -> &'a str
pub fn char_indices(self) -> CharIndices<'a>
pub fn chars(self) -> Chars<'a>
pub fn bytes(self) -> Bytes<'a>
pub fn advance(self, i: usize) -> ParseState<'a>
pub fn finish(self) -> ParseState<'a>
pub fn idx(self) -> usize
Trait Implementations§
Source§impl<'a> Clone for ParseState<'a>
impl<'a> Clone for ParseState<'a>
Source§fn clone(&self) -> ParseState<'a>
fn clone(&self) -> ParseState<'a>
Returns a copy 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 moreSource§impl<'a> Debug for ParseState<'a>
impl<'a> Debug for ParseState<'a>
impl<'a> Copy for ParseState<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParseState<'a>
impl<'a> RefUnwindSafe for ParseState<'a>
impl<'a> Send for ParseState<'a>
impl<'a> Sync for ParseState<'a>
impl<'a> Unpin for ParseState<'a>
impl<'a> UnwindSafe for ParseState<'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