pub struct StepDisplayState {
pub steps: Vec<Step>,
pub focused_step: Option<usize>,
pub scroll: u16,
}Expand description
State for step display widget
Fields§
§steps: Vec<Step>Steps
focused_step: Option<usize>Currently focused step index
scroll: u16Console scroll position
Implementations§
Source§impl StepDisplayState
impl StepDisplayState
Sourcepub fn current_step(&self) -> usize
pub fn current_step(&self) -> usize
Get current step index (first non-completed)
Sourcepub fn start_step(&mut self, index: usize)
pub fn start_step(&mut self, index: usize)
Start a step
Sourcepub fn complete_step(&mut self, index: usize)
pub fn complete_step(&mut self, index: usize)
Complete a step
Sourcepub fn start_sub_step(&mut self, step_index: usize, sub_index: usize)
pub fn start_sub_step(&mut self, step_index: usize, sub_index: usize)
Start a sub-step
Sourcepub fn complete_sub_step(&mut self, step_index: usize, sub_index: usize)
pub fn complete_sub_step(&mut self, step_index: usize, sub_index: usize)
Complete a sub-step
Sourcepub fn add_output(&mut self, step_index: usize, line: impl Into<String>)
pub fn add_output(&mut self, step_index: usize, line: impl Into<String>)
Add output to a step
Sourcepub fn toggle_expanded(&mut self, index: usize)
pub fn toggle_expanded(&mut self, index: usize)
Toggle expansion of a step
Sourcepub fn scroll_output(&mut self, index: usize, delta: i32)
pub fn scroll_output(&mut self, index: usize, delta: i32)
Scroll output for a step
Trait Implementations§
Source§impl Clone for StepDisplayState
impl Clone for StepDisplayState
Source§fn clone(&self) -> StepDisplayState
fn clone(&self) -> StepDisplayState
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 moreAuto Trait Implementations§
impl Freeze for StepDisplayState
impl RefUnwindSafe for StepDisplayState
impl Send for StepDisplayState
impl Sync for StepDisplayState
impl Unpin for StepDisplayState
impl UnwindSafe for StepDisplayState
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more