MissionState

Struct MissionState 

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

the longer-living application state

§mission: Mission<'m>

the mission to run, with settings

§cmd_result: CommandResult

result of a command, hopefully a report

§wrap: bool

whether the user wants wrapped lines

§backtrace: Option<&'static str>

the optional RUST_BACKTRACE env var to set

§auto_refresh: AutoRefresh

whether auto-refresh is enabled

§changes_since_last_job_start: usize

How many watch events were received since last job start

§show_changes_count: bool

whether to display the count of changes

§messages: Vec<Message>

messages to display to the user for a short duration

§search: SearchState

the search state

§dialog: Dialog

The dialog that may be displayed over the rest of the UI

Implementations§

Source§

impl<'a, 'm> MissionState<'a, 'm>

Source

pub fn new(app_state: &'a mut AppState, mission: Mission<'m>) -> Result<Self>

Source

pub fn open_jobs_menu(&mut self)

Source

pub fn open_menu(&mut self, def: ActionMenuDefinition)

Source

pub fn close_menu(&mut self)

Source

pub fn focus_file(&mut self, ffc: &FocusFileCommand)

Source

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

Source

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

Source

pub fn focus_goto(&mut self)

Source

pub fn dismiss_top_item(&mut self) -> bool

Source

pub fn dismiss_top_item_type(&mut self) -> bool

Source

pub fn dismiss_top(&mut self) -> bool

If possible, dismiss the whole type of the first item, if not dismiss just its location

Source

pub fn undismiss_all(&mut self)

Source

pub fn remove_dismissal(&mut self, dismissal: &Dismissal)

Source

pub fn open_undismiss_menu(&mut self)

Source

pub fn back(&mut self) -> bool

Source

pub fn copy_unstyled_output(&mut self)

Source

pub fn next_match(&mut self)

Source

pub fn previous_match(&mut self)

Source

pub fn validate(&mut self) -> bool

Source

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)

Source

pub fn add_line(&mut self, line: CommandOutputLine)

Source

pub fn new_task(&self) -> Task

Source

pub fn take_output(&mut self) -> Option<CommandOutput>

Source

pub fn has_report(&self) -> bool

Source

pub fn has_dismissed_items(&self) -> bool

Source

pub fn can_be_scoped(&self) -> bool

Source

pub fn failures_scope(&self) -> Option<Scope>

Source

pub fn toggle_raw_output(&mut self)

Source

pub fn finish_task(&mut self, exit_status: ExitStatus) -> Result<()>

Source

pub fn is_computing(&self) -> bool

Source

pub fn clear(&mut self)

Source

pub fn start_computation( &mut self, executor: &mut MissionExecutor, ) -> Result<TaskExecutor>

Start a new task on the current mission

Source

pub fn computation_starts(&mut self)

Called when a task has started

Source

pub fn computation_stops(&mut self)

Source

pub fn receive_watch_event(&mut self)

Source

pub fn keybindings(&self) -> &KeyBindings

Source

pub fn close_help(&mut self) -> bool

close the help and return true if it was open, return false otherwise

Source

pub fn is_help(&self) -> bool

Source

pub fn toggle_help(&mut self)

Source

pub fn toggle_summary_mode(&mut self)

Source

pub fn toggle_backtrace(&mut self, level: &'static str)

Source

pub fn toggle_wrap_mode(&mut self)

Source

pub fn resize(&mut self, width: u16, height: u16)

Source

pub fn apply_scroll_command(&mut self, cmd: ScrollCommand)

Source

pub fn job_badges(&self) -> Vec<TString>

Source

pub fn draw_badges(&mut self, w: &mut W, y: u16) -> Result<usize>

draw the line of colored badges, usually on top

Source

pub fn draw_computing(&mut self, w: &mut W, y: u16) -> Result<()>

draw “computing…”, the error code if any, or a blank line

Source

pub fn draw_message(&mut self, w: &mut W, y: u16) -> Result<()>

draw message

Source

pub fn is_success(&self) -> bool

Source

pub fn is_failure(&self) -> bool

Source

pub fn draw_content(&mut self, w: &mut W, y: u16) -> Result<()>

draw the report or the lines of the current computation, between y and self.page_height()

Source

pub fn draw(&mut self, w: &mut W) -> Result<()>

draw the state on the whole terminal

Auto Trait Implementations§

§

impl<'a, 'm> Freeze for MissionState<'a, 'm>

§

impl<'a, 'm> !RefUnwindSafe for MissionState<'a, 'm>

§

impl<'a, 'm> !Send for MissionState<'a, 'm>

§

impl<'a, 'm> !Sync for MissionState<'a, 'm>

§

impl<'a, 'm> Unpin for MissionState<'a, 'm>

§

impl<'a, 'm> !UnwindSafe for MissionState<'a, 'm>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T