Struct dogear::Tree [−][src]
pub struct Tree { /* fields omitted */ }
A complete, rooted bookmark tree with tombstones.
The tree stores bookmark nodes 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]
impl Tree
pub fn new(root: Item) -> Tree
[src]
pub fn new(root: Item) -> Tree
Constructs a new rooted tree.
pub fn root(&self) -> Node
[src]
pub fn root(&self) -> Node
pub fn deletions<'t>(
&'t self
) -> impl Iterator<Item = &Guid> + 't
[src]
pub fn deletions<'t>(
&'t self
) -> impl Iterator<Item = &Guid> + 't
pub fn is_deleted(&self, guid: &Guid) -> bool
[src]
pub fn is_deleted(&self, guid: &Guid) -> bool
pub fn note_deleted(&mut self, guid: Guid)
[src]
pub fn note_deleted(&mut self, guid: Guid)
pub fn guids<'t>(
&'t self
) -> impl Iterator<Item = &Guid> + 't
[src]
pub fn guids<'t>(
&'t self
) -> impl Iterator<Item = &Guid> + 't
pub fn node_for_guid(&self, guid: &Guid) -> Option<Node>
[src]
pub fn node_for_guid(&self, guid: &Guid) -> Option<Node>
pub fn insert(&mut self, parent_guid: &Guid, item: Item) -> Result<()>
[src]
pub fn insert(&mut self, parent_guid: &Guid, item: Item) -> Result<()>
Trait Implementations
impl Debug for Tree
[src]
impl Debug for Tree
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Tree
[src]
impl Default for Tree
impl Display for Tree
[src]
impl Display for Tree