pub trait Root {
type WeakRoot: WeakRoot;
// Required methods
fn messages_capacity(&self) -> usize;
fn num_tasks(&self) -> usize;
fn sorted_snapshot(&self, out: &mut Vec<(Key, Task)>);
fn copy_messages(&self, out: &mut Vec<Message>);
fn copy_new_messages(
&self,
out: &mut Vec<Message>,
prev: Option<MessageCopyState>
) -> MessageCopyState;
fn downgrade(&self) -> Self::WeakRoot;
}
Expand description
The top level of a progress task hierarchy, with progress::Task
s identified with progress::Key
s
Required Associated Types§
Required Methods§
sourcefn messages_capacity(&self) -> usize
fn messages_capacity(&self) -> usize
Returns the maximum amount of messages we can keep before overwriting older ones.
sourcefn num_tasks(&self) -> usize
fn num_tasks(&self) -> usize
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.
sourcefn sorted_snapshot(&self, out: &mut Vec<(Key, Task)>)
fn sorted_snapshot(&self, out: &mut Vec<(Key, Task)>)
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.
sourcefn copy_messages(&self, out: &mut Vec<Message>)
fn copy_messages(&self, out: &mut Vec<Message>)
Copy all messages from the internal ring buffer into the given out
vector. Messages are ordered from oldest to newest.
sourcefn copy_new_messages(
&self,
out: &mut Vec<Message>,
prev: Option<MessageCopyState>
) -> MessageCopyState
fn copy_new_messages( &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.