pub enum Action<R: Renderer> {
Event {
parent: Option<TaskId>,
data: R::EventData,
},
TaskStart {
id: TaskId,
parent: Option<TaskId>,
data: R::TaskData,
},
TaskEnd {
id: TaskId,
},
CancelAll,
}Expand description
A state change in the task tree.
§Example
use trace_tally::*;
struct MyRenderer;
impl Renderer for MyRenderer {
type EventData = String;
type TaskData = String;
}
let mut renderer = TaskRenderer::new(MyRenderer);
renderer.update(Action::TaskStart {
id: TaskId::from(2),
parent: None,
data: "my task".into(),
});
renderer.render(&mut std::io::stderr()).unwrap();Variants§
Event
A new event on an existing task (or the root if parent is None).
TaskStart
A new task has started.
If parent is None or refers to an unknown ID, the task is
attached to the virtual root.
TaskEnd
A task has completed.
CancelAll
Mark all pending tasks as cancelled.
Walks every task reachable from root and sets them as cancelled.
Cancelled tasks still render (via TaskView::cancelled) but are
flushed from the active frame on the next render, like completed tasks.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Action<R>
impl<R> RefUnwindSafe for Action<R>
impl<R> Send for Action<R>
impl<R> Sync for Action<R>
impl<R> Unpin for Action<R>
impl<R> UnsafeUnpin for Action<R>
impl<R> UnwindSafe for Action<R>
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