pub struct ActiveTasks { /* private fields */ }Expand description
Generic task store keyed by task id. Drop-in for App::active_tasks.
Implementations§
Source§impl ActiveTasks
impl ActiveTasks
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, id: &str) -> Option<&TaskState>
Sourcepub fn iter(&self) -> impl Iterator<Item = &TaskState>
pub fn iter(&self) -> impl Iterator<Item = &TaskState>
Iterate tasks in insertion (start) order.
Sourcepub fn apply(&mut self, event: TaskEvent)
pub fn apply(&mut self, event: TaskEvent)
Apply a parsed TaskEvent. Idempotent for repeated start (label/kind
updated). done keeps the task in the map so the UI can show a final
state until callers explicitly prune.
Sourcepub fn prune_completed(&mut self)
pub fn prune_completed(&mut self)
Remove all tasks whose done flag is set.
Trait Implementations§
Source§impl Clone for ActiveTasks
impl Clone for ActiveTasks
Source§fn clone(&self) -> ActiveTasks
fn clone(&self) -> ActiveTasks
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActiveTasks
impl Debug for ActiveTasks
Source§impl Default for ActiveTasks
impl Default for ActiveTasks
Source§fn default() -> ActiveTasks
fn default() -> ActiveTasks
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ActiveTasks
impl RefUnwindSafe for ActiveTasks
impl Send for ActiveTasks
impl Sync for ActiveTasks
impl Unpin for ActiveTasks
impl UnsafeUnpin for ActiveTasks
impl UnwindSafe for ActiveTasks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.