[][src]Struct ego_tree::NodeMut

pub struct NodeMut<'a, T: 'a> { /* fields omitted */ }

Node mutator.

Methods

impl<'a, T: 'a> NodeMut<'a, T>[src]

pub fn id(&self) -> NodeId[src]

Returns the ID of this node.

pub fn tree(&mut self) -> &mut Tree<T>[src]

Returns the tree owning this node.

pub fn value(&mut self) -> &mut T[src]

Returns the value of this node.

pub fn parent(&mut self) -> Option<NodeMut<T>>[src]

Returns the parent of this node.

pub fn prev_sibling(&mut self) -> Option<NodeMut<T>>[src]

Returns the previous sibling of this node.

pub fn next_sibling(&mut self) -> Option<NodeMut<T>>[src]

Returns the next sibling of this node.

pub fn first_child(&mut self) -> Option<NodeMut<T>>[src]

Returns the first child of this node.

pub fn last_child(&mut self) -> Option<NodeMut<T>>[src]

Returns the last child of this node.

pub fn has_siblings(&self) -> bool[src]

Returns true if this node has siblings.

pub fn has_children(&self) -> bool[src]

Returns true if this node has children.

pub fn append(&mut self, value: T) -> NodeMut<T>[src]

Appends a new child to this node.

pub fn prepend(&mut self, value: T) -> NodeMut<T>[src]

Prepends a new child to this node.

pub fn insert_before(&mut self, value: T) -> NodeMut<T>[src]

Inserts a new sibling before this node.

Panics

Panics if this node is an orphan.

pub fn insert_after(&mut self, value: T) -> NodeMut<T>[src]

Inserts a new sibling after this node.

Panics

Panics if this node is an orphan.

pub fn detach(&mut self)[src]

Detaches this node from its parent.

pub fn append_id(&mut self, new_child_id: NodeId) -> NodeMut<T>[src]

Appends a child to this node.

Panics

Panics if new_child_id is not valid.

pub fn prepend_id(&mut self, new_child_id: NodeId) -> NodeMut<T>[src]

Prepends a child to this node.

Panics

Panics if new_child_id is not valid.

pub fn insert_id_before(&mut self, new_sibling_id: NodeId) -> NodeMut<T>[src]

Inserts a sibling before this node.

Panics

  • Panics if new_sibling_id is not valid.
  • Panics if this node is an orphan.

pub fn insert_id_after(&mut self, new_sibling_id: NodeId) -> NodeMut<T>[src]

Inserts a sibling after this node.

Panics

  • Panics if new_sibling_id is not valid.
  • Panics if this node is an orphan.

pub fn reparent_from_id_append(&mut self, from_id: NodeId)[src]

Reparents the children of a node, appending them to this node.

Panics

Panics if from_id is not valid.

pub fn reparent_from_id_prepend(&mut self, from_id: NodeId)[src]

Reparents the children of a node, prepending them to this node.

Panics

Panics if from_id is not valid.

Trait Implementations

impl<'a, T: 'a> From<NodeMut<'a, T>> for NodeRef<'a, T>[src]

impl<'a, T: Debug + 'a> Debug for NodeMut<'a, T>[src]

Auto Trait Implementations

impl<'a, T> Send for NodeMut<'a, T> where
    T: Send

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

impl<'a, T> Sync for NodeMut<'a, T> where
    T: Sync

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

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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]