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

pub struct Root { /* fields omitted */ }

The top-level of the progress tree.

Implementations

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, Task)>)[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.

pub fn copy_new_messages(
    &self,
    out: &mut Vec<Message>,
    prev: Option<MessageCopyState>
) -> MessageCopyState
[src]

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

pub fn deep_clone(&self) -> Root[src]

Duplicate all content and return it.

This is an expensive operation, whereas clone() is not as it is shallow.

Trait Implementations

impl Clone for Root[src]

fn clone(&self) -> Root[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for Root[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Root[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl From<Options> for Root[src]

fn from(_: Options) -> Self[src]

Performs the conversion.

impl Root for Root[src]

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

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

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

Returns the current amount of tasks underneath the root, transitively. Note that this is at most a guess as tasks can be added and removed in parallel. Read more

fn sorted_snapshot(&self, out: &mut Vec<(Key, Task)>)[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. The out vec will be cleared automatically. Read more

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. Read more

fn copy_new_messages(
    &self,
    out: &mut Vec<Message>,
    prev: Option<MessageCopyState>
) -> MessageCopyState
[src]

Copy only new messages from the internal ring buffer into the given out vector. Messages are ordered from oldest to newest. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.