pub struct CommandBlock {
pub id: String,
pub title: String,
pub commands: Vec<Command>,
pub collapsed: bool,
pub selected_command: Option<usize>,
pub created_at: u64,
}Expand description
A block of related commands
Fields§
§id: StringBlock ID
title: StringBlock title/description
commands: Vec<Command>Commands in the block
collapsed: boolWhether block is collapsed
selected_command: Option<usize>Selected command index
created_at: u64Block creation timestamp
Implementations§
Source§impl CommandBlock
impl CommandBlock
Sourcepub fn add_command(&mut self, command: Command)
pub fn add_command(&mut self, command: Command)
Add a command to the block
Sourcepub fn overall_status(&self) -> CommandStatus
pub fn overall_status(&self) -> CommandStatus
Get the overall status of the block
Sourcepub fn toggle_collapsed(&mut self)
pub fn toggle_collapsed(&mut self)
Toggle collapsed state
Sourcepub fn visible_commands(&self) -> Vec<&Command>
pub fn visible_commands(&self) -> Vec<&Command>
Get visible commands
Sourcepub fn select_next_command(&mut self)
pub fn select_next_command(&mut self)
Select next command
Sourcepub fn select_prev_command(&mut self)
pub fn select_prev_command(&mut self)
Select previous command
Sourcepub fn get_selected_command(&self) -> Option<&Command>
pub fn get_selected_command(&self) -> Option<&Command>
Get the selected command
Sourcepub fn get_selected_command_mut(&mut self) -> Option<&mut Command>
pub fn get_selected_command_mut(&mut self) -> Option<&mut Command>
Get the selected command (mutable)
Sourcepub fn total_duration_secs(&self) -> u64
pub fn total_duration_secs(&self) -> u64
Get total duration of all commands
Sourcepub fn success_count(&self) -> usize
pub fn success_count(&self) -> usize
Get the number of successful commands
Sourcepub fn failed_count(&self) -> usize
pub fn failed_count(&self) -> usize
Get the number of failed commands
Sourcepub fn running_count(&self) -> usize
pub fn running_count(&self) -> usize
Get the number of running commands
Trait Implementations§
Source§impl Clone for CommandBlock
impl Clone for CommandBlock
Source§fn clone(&self) -> CommandBlock
fn clone(&self) -> CommandBlock
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 CommandBlock
impl RefUnwindSafe for CommandBlock
impl Send for CommandBlock
impl Sync for CommandBlock
impl Unpin for CommandBlock
impl UnwindSafe for CommandBlock
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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