Struct linked_syntax_tree::Cursor
source · pub struct Cursor<'a, T> { /* private fields */ }
Expand description
Roughly matches std::collections::linked_list::Cursor
.
Implementations§
source§impl<T: Debug> Cursor<'_, T>
impl<T: Debug> Cursor<'_, T>
sourcepub fn move_pred(&mut self)
pub fn move_pred(&mut self)
Moves the cursor to predecessor element.
If there is no previous value, the cursor is not moved.
sourcepub fn move_child(&mut self)
pub fn move_child(&mut self)
Moves the cursor to the child element.
sourcepub fn move_parent(&mut self)
pub fn move_parent(&mut self)
Moves the cursor through predecessor elements until reaching a parent or the first element.
sourcepub fn peek_parent(&self) -> Option<&T>
pub fn peek_parent(&self) -> Option<&T>
Returns a reference to the parent element.
Wrapper around self.peek_predecessor().and_then(Predecessor::parent)
.
sourcepub fn peek_previous(&self) -> Option<&T>
pub fn peek_previous(&self) -> Option<&T>
Returns a reference to the previous element.
Wrapper around self.peek_predecessor().and_then(Predecessor::previous)
.
sourcepub fn peek_predecessor(&self) -> Option<Predecessor<&T>>
pub fn peek_predecessor(&self) -> Option<Predecessor<&T>>
Returns a reference to the predecessor element.
sourcepub fn peek_child(&self) -> Option<&T>
pub fn peek_child(&self) -> Option<&T>
Returns a reference to the child element.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> RefUnwindSafe for Cursor<'a, T>where T: RefUnwindSafe,
impl<'a, T> !Send for Cursor<'a, T>
impl<'a, T> !Sync for Cursor<'a, T>
impl<'a, T> Unpin for Cursor<'a, T>
impl<'a, T> UnwindSafe for Cursor<'a, T>where T: 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