pub struct CursorMut<'a, T> { /* private fields */ }
Expand description

Implementations§

source§

impl<T> CursorMut<'_, T>

source

pub fn root_mut(&mut self) -> Option<&mut T>

Provides a mutable reference to the root element.

source

pub fn current_mut(&mut self) -> Option<&mut T>

Get the current element.

source

pub fn insert_predecessor(&mut self, item: T)

Inserts an element before the current element.

If the cursor has None current element it is set to the inserted element.

source

pub fn insert_next(&mut self, item: T)

Inserts an element after the current element.

If the cursor has None current element it is set to the inserted element.

source

pub fn insert_child(&mut self, item: T)

Inserts an element as a child of the current element.

If the cursor has None current element it is set to the inserted element.

source

pub fn remove_current(&mut self)

Removes the current node.

When removing a node with a child node, this child node is removed.

source

pub fn splice_after(&mut self, tree: SyntaxTree<T>)

Inserts the elements from the given SyntaxTree after the current one.

If the current element is None it becomes the root element from the given SyntaxTree.

source

pub fn splice_before(&mut self, tree: SyntaxTree<T>)

Inserts the elements from the given SyntaxTree before the current one.

If the current element is None it becomes the root element from the given SyntaxTree.

source

pub fn split_after(&mut self) -> SyntaxTree<T>

Splits the list into two after the current element. This will return a new list consisting of everything after the cursor, with the original list retaining everything before.

source

pub fn split_before(&mut self) -> SyntaxTree<T>

Splits the list into two before the current element. This will return a new list consisting of everything before the cursor, with the original list retaining everything after.

Methods from Deref<Target = Cursor<'a, T>>§

source

pub fn root(&self) -> Option<&T>

Provides a reference to the root element.

source

pub fn current(&self) -> Option<&T>

Get the current element.

source

pub fn move_pred(&mut self)

Moves the cursor to predecessor element.

If there is no previous value, the cursor is not moved.

source

pub fn move_next(&mut self)

Moves the cursor to the next element.

source

pub fn move_child(&mut self)

Moves the cursor to the child element.

source

pub fn move_parent(&mut self)

Moves the cursor through predecessor elements until reaching a parent or the first element.

source

pub fn peek_next(&self) -> Option<&T>

Returns a reference to the next element.

source

pub fn peek_pred(&self) -> Option<&T>

Returns a reference to the predecessor element.

source

pub fn peek_child(&self) -> Option<&T>

Returns a reference to the child element.

Trait Implementations§

source§

impl<'a, T: Debug> Debug for CursorMut<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> Deref for CursorMut<'a, T>

§

type Target = Cursor<'a, T>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, T> DerefMut for CursorMut<'a, T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for CursorMut<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> !Send for CursorMut<'a, T>

§

impl<'a, T> !Sync for CursorMut<'a, T>

§

impl<'a, T> Unpin for CursorMut<'a, T>

§

impl<'a, T> !UnwindSafe for CursorMut<'a, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.