Struct prodash::tree::Root [−][src]
pub struct Root { /* fields omitted */ }
The top-level of the progress tree.
Implementations
impl Root
[src]
impl Root
[src]pub fn new() -> 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]
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]
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]
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, Task)>)
[src]
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]
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]
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]
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 Root for Root
[src]
impl Root for Root
[src]fn messages_capacity(&self) -> usize
[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]
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]
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]
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]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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