[][src]Struct prodash::tree::Root

pub struct Root { /* fields omitted */ }

The top-level of the progress tree.

Methods

impl Root[src]

pub fn new() -> Root[src]

Create a new tree with default configuration.

As opposed to Item instances, this type can be closed and sent safely across threads.

pub fn messages_capacity(&self) -> usize[src]

Returns the maximum amount of messages we can keep before overwriting older ones.

pub fn num_tasks(&self) -> usize[src]

Returns the current amount of Items stored in the tree. Note that this is at most a guess as tasks can be added and removed in parallel.

pub fn add_child(&self, name: impl Into<String>) -> Item[src]

Adds a new child tree::Item, whose parent is this instance, with the given name.

This builds a hierarchy of tree::Items, each having their own progress. Use this method to track progress of your first tasks.

pub fn sorted_snapshot(&self, out: &mut Vec<(Key, Value)>)[src]

Copy the entire progress tree into the given out vector, so that it can be traversed from beginning to end in order of hierarchy.

pub fn copy_messages(&self, out: &mut Vec<Message>)[src]

Copy all messages from the internal ring buffer into the given out vector. Messages are ordered from oldest to newest.

Trait Implementations

impl Clone for Root[src]

impl Debug for Root[src]

impl From<TreeOptions> for Tree[src]

Auto Trait Implementations

impl !RefUnwindSafe for Root

impl Send for Root

impl Sync for Root

impl Unpin for Root

impl !UnwindSafe for Root

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.