pub struct MissionState<'a, 'm> {
pub app_state: &'a mut AppState,
pub mission: Mission<'m>,
pub cmd_result: CommandResult,
pub wrap: bool,
pub backtrace: Option<&'static str>,
pub auto_refresh: AutoRefresh,
pub changes_since_last_job_start: usize,
pub show_changes_count: bool,
pub messages: Vec<Message>,
pub search: SearchState,
pub dialog: Dialog,
/* private fields */
}Expand description
State of the TUI application for the duration of a mission
Fields§
§app_state: &'a mut AppStatethe longer-living application state
mission: Mission<'m>the mission to run, with settings
cmd_result: CommandResultresult of a command, hopefully a report
wrap: boolwhether the user wants wrapped lines
backtrace: Option<&'static str>the optional RUST_BACKTRACE env var to set
auto_refresh: AutoRefreshwhether auto-refresh is enabled
changes_since_last_job_start: usizeHow many watch events were received since last job start
show_changes_count: boolwhether to display the count of changes
messages: Vec<Message>messages to display to the user for a short duration
search: SearchStatethe search state
dialog: DialogThe dialog that may be displayed over the rest of the UI
Implementations§
Source§impl<'a, 'm> MissionState<'a, 'm>
impl<'a, 'm> MissionState<'a, 'm>
pub fn new(app_state: &'a mut AppState, mission: Mission<'m>) -> Result<Self>
pub fn focus_file(&mut self, ffc: &FocusFileCommand)
Sourcepub fn show_item(&mut self, item_idx: usize)
pub fn show_item(&mut self, item_idx: usize)
Show a specific diagnostic item by index and scroll to show it
Do nothing if there’s no such item
pub fn top_item_idx(&self) -> Option<usize>
pub fn focus_search(&mut self)
pub fn focus_goto(&mut self)
pub fn dismiss_top_item(&mut self) -> bool
pub fn dismiss_top_item_type(&mut self) -> bool
Sourcepub fn dismiss_top(&mut self) -> bool
pub fn dismiss_top(&mut self) -> bool
If possible, dismiss the whole type of the first item, if not dismiss just its location
pub fn undismiss_all(&mut self)
pub fn remove_dismissal(&mut self, dismissal: &Dismissal)
pub fn back(&mut self) -> bool
pub fn copy_unstyled_output(&mut self)
pub fn next_match(&mut self)
pub fn previous_match(&mut self)
pub fn validate(&mut self) -> bool
pub fn has_search(&self) -> bool
Sourcepub fn on_key(&mut self, key: KeyCombination) -> Option<Action>
pub fn on_key(&mut self, key: KeyCombination) -> Option<Action>
handle a raw, uninterpreted key combination (in an input if there’s one focused), return an action (may be noop) if the key was consumed (if not, keybindings will be computed by the app)
pub fn update_search(&mut self)
pub fn add_line(&mut self, line: CommandOutputLine)
pub fn new_task(&self) -> Task
pub fn take_output(&mut self) -> Option<CommandOutput>
pub fn has_report(&self) -> bool
pub fn has_dismissed_items(&self) -> bool
pub fn can_be_scoped(&self) -> bool
pub fn failures_scope(&self) -> Option<Scope>
pub fn toggle_raw_output(&mut self)
pub fn finish_task(&mut self, exit_status: ExitStatus) -> Result<()>
pub fn is_computing(&self) -> bool
pub fn clear(&mut self)
Sourcepub fn start_computation(
&mut self,
executor: &mut MissionExecutor,
) -> Result<TaskExecutor>
pub fn start_computation( &mut self, executor: &mut MissionExecutor, ) -> Result<TaskExecutor>
Start a new task on the current mission
Sourcepub fn computation_starts(&mut self)
pub fn computation_starts(&mut self)
Called when a task has started
pub fn computation_stops(&mut self)
pub fn receive_watch_event(&mut self)
pub fn keybindings(&self) -> &KeyBindings
Sourcepub fn close_help(&mut self) -> bool
pub fn close_help(&mut self) -> bool
close the help and return true if it was open, return false otherwise
pub fn is_help(&self) -> bool
pub fn toggle_help(&mut self)
pub fn toggle_summary_mode(&mut self)
pub fn toggle_backtrace(&mut self, level: &'static str)
pub fn toggle_wrap_mode(&mut self)
pub fn resize(&mut self, width: u16, height: u16)
pub fn apply_scroll_command(&mut self, cmd: ScrollCommand)
pub fn job_badges(&self) -> Vec<TString>
Sourcepub fn draw_badges(&mut self, w: &mut W, y: u16) -> Result<usize>
pub fn draw_badges(&mut self, w: &mut W, y: u16) -> Result<usize>
draw the line of colored badges, usually on top
Sourcepub fn draw_computing(&mut self, w: &mut W, y: u16) -> Result<()>
pub fn draw_computing(&mut self, w: &mut W, y: u16) -> Result<()>
draw “computing…”, the error code if any, or a blank line