Trait prodash::Root

source ·
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::Tasks identified with progress::Keys

Required Associated Types§

source

type WeakRoot: WeakRoot

The type implementing the WeakRoot trait

Required Methods§

source

fn messages_capacity(&self) -> usize

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

source

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.

source

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.

source

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.

source

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.

source

fn downgrade(&self) -> Self::WeakRoot

Similar to Arc::downgrade()

Implementations on Foreign Types§

source§

impl Root for Arc<Root>

Implementors§