Struct aatree::node::AANode

source ·
pub struct AANode<T>(_);

Implementations§

Insert a new node with content into the tree. If a node with this value already exist, nothing will be inserted, and false will be returned.

Insert a new node with content into the tree. If a node with this value already exists, it will be replaced and the old content returned.

Remove a value from this tree. If the value was found, it will be returned.

Traverse the tree looking for a specific value.

down_callback is called for each node on the way down the tree. It is passed the value contained in the current node and may return either Left or Right to continue the traversal in that direction, or Value to stop the traversal, for example because a value was found.

up_callback is called while going back up with the content of each node and the result of traversing so far (i.e., None for the first call when the search hit a leaf, or the return value of the last callback execution otherwise).

Create a new Nil node.

Return true if this node is Nil.

Return true if this node is a leaf.

Return true if this node has a left child.

Return true if this node has a right child.

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
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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
Converts to this type from the input type.

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.