Struct dogear::Tree

source · []
pub struct Tree { /* private fields */ }
Expand description

A complete, rooted bookmark tree with tombstones.

The tree stores bookmark items in a vector, and uses indices in the vector to identify parents and children. This makes traversal and lookup very efficient. Retrieving a node’s parent takes one indexing operation, retrieving children takes one indexing operation per child, and retrieving a node by random GUID takes one hash map lookup and one indexing operation.

Implementations

Returns a builder for a rooted tree.

Returns the number of nodes in the tree.

Returns the root node.

Returns the set of all tombstoned GUIDs.

Indicates if the GUID exists in the tree.

Indicates if the GUID is known to be deleted. If Tree::node_for_guid returns None and Tree::is_deleted returns false, the item doesn’t exist in the tree at all.

Indicates if the GUID is mentioned in the tree, either as a node or a deletion.

Returns an iterator for all node and tombstone GUIDs.

Returns the node for a given guid, or None if a node with the guid doesn’t exist in the tree, or was deleted.

Returns the structure divergences found when building the tree.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Builds a tree from all stored items and parent-child associations, resolving inconsistencies like orphans, multiple parents, and parent-child disagreements.

The type returned in the event of a conversion error.

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.

Converts the given value to a String. 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.