TaskProgressView

Struct TaskProgressView 

Source
pub struct TaskProgressView { /* private fields */ }
Expand description

A full-screen view for multi-step task execution with progress display.

Implementations§

Source§

impl TaskProgressView

Source

pub fn builder(steps: Vec<TaskStep>) -> TaskProgressViewBuilder

Create a builder for a new TaskProgressView with the given steps.

Use the builder pattern for configuration:

TaskProgressView::builder(steps)
    .title("My App")
    .auto_start()
    .build()
Source

pub fn with_context<C: Any + Send + Sync>( steps: Vec<TaskStep>, context: C, ) -> TaskProgressViewBuilder

Create a new TaskProgressView with steps and a context.

The context is used by the confirmation modal’s content_fn.

Source

pub fn should_quit(&self) -> bool

Check if the view should quit.

Source

pub fn was_cancelled(&self) -> bool

Check if the operation was cancelled by user.

Source

pub fn is_success(&self) -> bool

Check if completed successfully.

Source

pub fn has_failure(&self) -> bool

Check if there was a failure.

Source

pub fn start_task(&mut self, index: usize)

Start a task by index (for external control mode).

Source

pub fn complete_task(&mut self, index: usize, result: StepResult)

Complete a task with result (for external control mode).

Source

pub fn is_running(&self) -> bool

Check if a task is currently running.

Source

pub fn is_all_complete(&self) -> bool

Check if all tasks are complete.

Source

pub fn current_task_index(&self) -> Option<usize>

Get current task index.

Source

pub fn phase(&self) -> &Phase

Get the current phase.

Trait Implementations§

Source§

impl Model for TaskProgressView

Source§

type Message = TaskProgressMsg

The message type for this model. Read more
Source§

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>>

Handle a message and update the model state. Read more
Source§

fn view(&self) -> String

Render the model as a string for display. Read more
Source§

fn handle_event(&self, event: Event) -> Option<Self::Message>

Convert terminal events to messages. Read more
Source§

fn subscriptions(&self) -> Sub<Self::Message>

Declare subscriptions for recurring events. Read more
Source§

fn wants_tick(&self) -> bool

Whether this model should receive tick updates. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.