pub struct Cursor<'a, Span> { /* private fields */ }
Implementations§
Source§impl<'a, Span: Copy> Cursor<'a, Span>
impl<'a, Span: Copy> Cursor<'a, Span>
pub fn new(buffer: &'a [TokenTree<Span>]) -> Self
pub fn is_root(&self) -> bool
pub fn end(&mut self) -> &'a Subtree<Span>
Sourcepub fn token_tree(&self) -> Option<&'a TokenTree<Span>>
pub fn token_tree(&self) -> Option<&'a TokenTree<Span>>
Returns the TokenTree
at the cursor if it is not at the end of a subtree.
pub fn bump_or_end(&mut self)
pub fn peek_two_leaves(&self) -> Option<[&'a Leaf<Span>; 2]>
pub fn crossed(&self) -> TokenTreesView<'a, Span>
Auto Trait Implementations§
impl<'a, Span> Freeze for Cursor<'a, Span>
impl<'a, Span> RefUnwindSafe for Cursor<'a, Span>where
Span: RefUnwindSafe,
impl<'a, Span> Send for Cursor<'a, Span>where
Span: Sync,
impl<'a, Span> Sync for Cursor<'a, Span>where
Span: Sync,
impl<'a, Span> Unpin for Cursor<'a, Span>
impl<'a, Span> UnwindSafe for Cursor<'a, Span>where
Span: RefUnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more