[−][src]Struct dogear::Tree
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.
Methods
impl Tree
[src]
pub fn with_root(root: Item) -> Builder
[src]
Returns a builder for a rooted tree.
pub fn size(&self) -> usize
[src]
Returns the number of nodes in the tree.
pub fn root(&self) -> Node
[src]
Returns the root node.
pub fn deletions(&self) -> impl Iterator<Item = &Guid>
[src]
Returns an iterator for all tombstoned GUIDs.
pub fn is_deleted(&self, guid: &Guid) -> bool
[src]
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.
pub fn note_deleted(&mut self, guid: Guid)
[src]
Notes a tombstone for a deleted item.
pub fn guids(&self) -> impl Iterator<Item = &Guid>
[src]
Returns an iterator for all node and tombstone GUIDs.
pub fn node_for_guid(&self, guid: &Guid) -> Option<Node>
[src]
Returns the node for a given guid
, or None
if a node with the guid
doesn't exist in the tree, or was deleted.
pub fn problems(&self) -> &Problems
[src]
Returns the structure divergences found when building the tree.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,