pub struct Cursor<'a> { /* private fields */ }Expand description
A position in some text, and the bash word grammar over it.
Built by parse_with, which is also what checks that a grammar consumed
the whole input.
Implementations§
Source§impl<'a> Cursor<'a>
impl<'a> Cursor<'a>
pub fn at_end(&self) -> bool
pub fn peek(&self) -> Option<char>
pub fn starts_with(&self, text: &str) -> bool
Sourcepub fn fail(&self, message: impl Into<String>) -> ParseError
pub fn fail(&self, message: impl Into<String>) -> ParseError
A refusal at the current position, carrying the text around it.
Auto Trait Implementations§
impl<'a> Freeze for Cursor<'a>
impl<'a> RefUnwindSafe for Cursor<'a>
impl<'a> Send for Cursor<'a>
impl<'a> Sync for Cursor<'a>
impl<'a> Unpin for Cursor<'a>
impl<'a> UnsafeUnpin for Cursor<'a>
impl<'a> UnwindSafe for Cursor<'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