pub struct Cursor<'a> { /* private fields */ }
Expand description
Peekable iterator over a char sequence.
Next characters can be peeked via first
method,
and position can be shifted forward via bump
method.
Implementations§
Source§impl<'a> Cursor<'a>
impl<'a> Cursor<'a>
pub fn new(input: &'a str) -> Cursor<'a>
pub fn as_str(&self) -> &'a str
Source§impl Cursor<'_>
impl Cursor<'_>
Sourcepub fn advance_token(&mut self) -> Token
pub fn advance_token(&mut self) -> Token
Parses a token from the input string.
Sourcepub fn guarded_double_quoted_string(&mut self) -> Option<GuardedStr>
pub fn guarded_double_quoted_string(&mut self) -> Option<GuardedStr>
Attempt to lex for a guarded string literal.
Used by rustc_parse::lexer
to lex for guarded strings
conditionally based on edition.
Note: this will not reset the Cursor
when a
guarded string is not found. It is the caller’s
responsibility to do so.
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> 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