pub struct TaskList { /* private fields */ }Expand description
A list of tasks with status indicators.
Implementations§
Source§impl TaskList
impl TaskList
Sourcepub fn add_task_with_detail(
self,
name: impl Into<String>,
detail: impl Into<String>,
) -> Self
pub fn add_task_with_detail( self, name: impl Into<String>, detail: impl Into<String>, ) -> Self
Add a task with a detail.
Sourcepub fn start_task(&mut self, index: usize)
pub fn start_task(&mut self, index: usize)
Start a task (set to Running).
Sourcepub fn complete_task(&mut self, index: usize, detail: Option<String>)
pub fn complete_task(&mut self, index: usize, detail: Option<String>)
Complete a task successfully.
Sourcepub fn is_all_complete(&self) -> bool
pub fn is_all_complete(&self) -> bool
Check if all tasks are complete.
Sourcepub fn has_failure(&self) -> bool
pub fn has_failure(&self) -> bool
Check if any task has failed.
Sourcepub fn first_failure(&self) -> Option<&TaskItem>
pub fn first_failure(&self) -> Option<&TaskItem>
Get the first failed task.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if any task is currently running.
Sourcepub fn current_task_index(&self) -> Option<usize>
pub fn current_task_index(&self) -> Option<usize>
Get the index of the current running task.
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Count the lines rendered by this task list.
Trait Implementations§
Source§impl Model for TaskList
impl Model for TaskList
Source§type Message = TaskListMsg
type Message = TaskListMsg
The message type for this model. Read more
Source§fn init(&self) -> Option<Cmd<Self::Message>>
fn init(&self) -> Option<Cmd<Self::Message>>
Initialize the model, returning an optional startup command. Read more
Source§fn update(&mut self, msg: Self::Message) -> Option<Cmd<Self::Message>>
fn update(&mut self, msg: Self::Message) -> Option<Cmd<Self::Message>>
Handle a message and update the model state. Read more
Source§fn handle_event(&self, _event: Event) -> Option<Self::Message>
fn handle_event(&self, _event: Event) -> Option<Self::Message>
Convert terminal events to messages. Read more
Source§fn subscriptions(&self) -> Sub<Self::Message>
fn subscriptions(&self) -> Sub<Self::Message>
Declare subscriptions for recurring events. Read more
Source§fn wants_tick(&self) -> bool
fn wants_tick(&self) -> bool
Whether this model should receive tick updates. Read more
Auto Trait Implementations§
impl Freeze for TaskList
impl RefUnwindSafe for TaskList
impl Send for TaskList
impl Sync for TaskList
impl Unpin for TaskList
impl UnwindSafe for TaskList
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