[−][src]Struct prodash::tree::Root
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 Item
s 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::Item
s, 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.
pub fn copy_new_messages(
&self,
out: &mut Vec<Message>,
prev: Option<MessageCopyState>
) -> MessageCopyState
[src]
&self,
out: &mut Vec<Message>,
prev: Option<MessageCopyState>
) -> MessageCopyState
Copy only new messages from the internal ring buffer into the given out
vector. Messages are ordered from oldest to newest.
pub fn message_buffer_usage(&self) -> (usize, usize)
[src]
Return the amount of messages currently stored as well as the maximum amount we can ever store (i.e. capacity)
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.
pub fn deep_eq(&self, other: &Root) -> bool
[src]
Compare all content in this root and the given one to see if they are the same.
Trait Implementations
impl Clone for Root
[src]
impl Debug for Root
[src]
impl Default for Root
[src]
impl From<TreeOptions> for Tree
[src]
fn from(
TreeOptions { initial_capacity: initial_capacity, message_buffer_capacity: message_buffer_capacity }: TreeOptions
) -> Self
[src]
TreeOptions { initial_capacity: initial_capacity, message_buffer_capacity: message_buffer_capacity }: TreeOptions
) -> Self
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,