[][src]Struct dogear::Node

pub struct Node<'t>(_, _);

A node in a bookmark tree that knows its parent and children, and dereferences to its item.

Methods

impl<'t> Node<'t>[src]

pub fn content(&self) -> Option<&'t Content>[src]

Returns content info for deduping this item, if available.

pub fn children<'n>(&'n self) -> impl Iterator<Item = Node<'t>> + 'n[src]

Returns an iterator for all children of this node.

pub fn child(&self, index: usize) -> Option<Node>[src]

Returns the child at the given index, or None if the index is out of bounds.

pub fn has_matching_children<'u>(&self, other: Node<'u>) -> bool[src]

Returns true if this and other have the same child GUIDs.

pub fn parent(&self) -> Option<Node>[src]

Returns the resolved parent of this node, or None if this is the root node.

pub fn level(&self) -> i64[src]

Returns the level of this node in the tree.

pub fn is_syncable(&self) -> bool[src]

Indicates if this node is for a syncable item.

Syncable items descend from the four user content roots. For historical reasons, the Desktop tags root and its descendants are also marked as syncable, even though they are not part of the synced tree structure. Any other roots and their descendants, like the left pane root, left pane queries, and custom roots, are non-syncable.

Newer Desktops should never reupload non-syncable items (bug 1274496), and should have removed them in Places migrations (bug 1310295). However, these items may be reparented locally to unfiled, in which case they're seen as syncable. If the remote tree has the missing parents and roots, we'll determine that the items are non-syncable when merging, remove them locally, and mark them for deletion remotely.

pub fn diverged(&self) -> bool[src]

Indicates if this node's structure diverged because it existed in multiple parents, or was reparented.

pub fn to_ascii_string(&self) -> String[src]

Returns an ASCII art (with emoji!) representation of this node and all its descendants. Handy for logging.

pub fn is_root(&self) -> bool[src]

Indicates if this node is the root node.

pub fn is_built_in_root(&self) -> bool[src]

Indicates if this node is a Places built-in root. Any other roots except these are non-syncable.

Methods from Deref<Target = Item>

pub fn is_folder(&self) -> bool[src]

Indicates if the item is a folder. Only folders are allowed to have children.

pub fn has_compatible_kind(&self, remote_node: &Item) -> bool[src]

Indicates if the item can be merged with another item. Only items with compatible kinds can be merged.

Trait Implementations

impl<'t> Clone for Node<'t>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'t> Copy for Node<'t>[src]

impl<'t> Deref for Node<'t>[src]

type Target = Item

The resulting type after dereferencing.

impl<'t> Debug for Node<'t>[src]

impl<'t> Display for Node<'t>[src]

Auto Trait Implementations

impl<'t> Unpin for Node<'t>

impl<'t> Sync for Node<'t>

impl<'t> Send for Node<'t>

impl<'t> UnwindSafe for Node<'t>

impl<'t> RefUnwindSafe for Node<'t>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]