pub struct Tree<T> { /* private fields */ }

Implementations

Make the child nodes as the last child of the parent node.

Errors
  • Fails of the same NodeId is passed
  • TODO: Fail if the child node is parent of the parent node.

Make the node as the previous sibling of sibling

Errors
  • Fails of the same NodeId is passed
  • TODO: Fail if the child node is parent of the parent node.

Make the node as the next sibling of sibling

Errors
  • Fails of the same NodeId is passed
  • TODO: Fail if the child node is parent of the parent node.

Detach the node from it’s parent

Errors
  • Fails of the node was removed

Create a new tree.

Create a new tree with a specific parameter.

Add a node to the tree, without relations with the other nodes.

Remove a node.

If there are some children nodes, they will became the first node if we are removing the first node. Otherwise they will become orphan nodes.

It will consume the NodeId.

Errors

Fails if the NodeId is invalid.

Appends the value to the last element of the three as its child. If None creates a new root.

Appends the value to the last element of the three as its sibling. If None creates a new root.

Appends a new node as child of the given one

Errors

Will error if the given node id was removed.

Insert a new node after the as the sibling of the given one

Errors

Will error if the given node id was removed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.