Struct StepCursor
struct StepCursor<'c, 'a> { ... }
Cursor state associated with speculative parsing.
This type is the input of the closure provided to ParseStream::step.
Example
use TokenTree;
use Result;
use ParseStream;
// This function advances the stream past the next occurrence of `@`. If
// no `@` is present in the stream, the stream position is unchanged and
// an error is returned.
#
#
#
# use Parser;
# let remainder = remainder_after_skipping_past_next_at
# .parse_str
# .unwrap;
# assert_eq!;
Implementations
impl<'c, 'a> StepCursor<'c, 'a>
fn error<T: Display>(self: Self, message: T) -> ErrorTriggers an error at the current position of the parse stream.
The
ParseStream::stepinvocation will return this same error without advancing the stream state.
impl<'c, 'a> Clone for StepCursor<'c, 'a>
fn clone(self: &Self) -> Self
impl<'c, 'a> Copy for StepCursor<'c, 'a>
impl<'c, 'a> Deref for StepCursor<'c, 'a>
fn deref(self: &Self) -> &<Self as >::Target
impl<'c, 'a> Freeze for StepCursor<'c, 'a>
impl<'c, 'a> RefUnwindSafe for StepCursor<'c, 'a>
impl<'c, 'a> Send for StepCursor<'c, 'a>
impl<'c, 'a> Sync for StepCursor<'c, 'a>
impl<'c, 'a> Unpin for StepCursor<'c, 'a>
impl<'c, 'a> UnwindSafe for StepCursor<'c, 'a>
impl<P, T> Receiver for StepCursor<'c, 'a>
impl<T> Any for StepCursor<'c, 'a>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for StepCursor<'c, 'a>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for StepCursor<'c, 'a>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for StepCursor<'c, 'a>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for StepCursor<'c, 'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for StepCursor<'c, 'a>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for StepCursor<'c, 'a>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for StepCursor<'c, 'a>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for StepCursor<'c, 'a>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>