[][src]Trait broot::app::AppState

pub trait AppState {
    fn on_internal(
        &mut self,
        w: &mut W,
        internal_exec: &InternalExecution,
        input_invocation: Option<&VerbInvocation>,
        trigger_type: TriggerType,
        cc: &CmdContext,
        screen: &mut Screen
    ) -> Result<AppStateCmdResult, ProgramError>;
fn selected_path(&self) -> &Path;
fn selection_type(&self) -> SelectionType;
fn refresh(&mut self, screen: &Screen, con: &AppContext) -> Command;
fn do_pending_task(
        &mut self,
        screen: &mut Screen,
        con: &AppContext,
        dam: &mut Dam
    );
fn get_pending_task(&self) -> Option<&'static str>;
fn display(
        &mut self,
        w: &mut W,
        screen: &Screen,
        state_area: Area,
        skin: &PanelSkin,
        con: &AppContext
    ) -> Result<(), ProgramError>;
fn get_status(
        &self,
        cmd: &Command,
        other_path: &Option<PathBuf>,
        con: &AppContext
    ) -> Status;
fn get_flags(&self) -> Vec<Flag>; fn clear_pending(&mut self) { ... }
fn on_click(
        &mut self,
        _x: u16,
        _y: u16,
        _screen: &mut Screen,
        _con: &AppContext
    ) -> Result<AppStateCmdResult, ProgramError> { ... }
fn on_double_click(
        &mut self,
        _x: u16,
        _y: u16,
        _screen: &mut Screen,
        _con: &AppContext
    ) -> Result<AppStateCmdResult, ProgramError> { ... }
fn on_pattern(
        &mut self,
        _pat: InputPattern,
        _con: &AppContext
    ) -> Result<AppStateCmdResult, ProgramError> { ... }
fn on_command(
        &mut self,
        w: &mut W,
        cc: &CmdContext,
        screen: &mut Screen
    ) -> Result<AppStateCmdResult, ProgramError> { ... }
fn get_starting_input(&self) -> String { ... } }

a whole application state, stackable to allow reverting to a previous one

Required methods

fn on_internal(
    &mut self,
    w: &mut W,
    internal_exec: &InternalExecution,
    input_invocation: Option<&VerbInvocation>,
    trigger_type: TriggerType,
    cc: &CmdContext,
    screen: &mut Screen
) -> Result<AppStateCmdResult, ProgramError>

execute the internal with the optional given invocation.

The invocation comes from the input and may be related to a different verb (the verb may have been triggered by a key shorctut)

fn selected_path(&self) -> &Path

fn selection_type(&self) -> SelectionType

fn refresh(&mut self, screen: &Screen, con: &AppContext) -> Command

fn do_pending_task(
    &mut self,
    screen: &mut Screen,
    con: &AppContext,
    dam: &mut Dam
)

fn get_pending_task(&self) -> Option<&'static str>

fn display(
    &mut self,
    w: &mut W,
    screen: &Screen,
    state_area: Area,
    skin: &PanelSkin,
    con: &AppContext
) -> Result<(), ProgramError>

fn get_status(
    &self,
    cmd: &Command,
    other_path: &Option<PathBuf>,
    con: &AppContext
) -> Status

fn get_flags(&self) -> Vec<Flag>

return the flags to display

Loading content...

Provided methods

fn clear_pending(&mut self)

called on start of on_command

fn on_click(
    &mut self,
    _x: u16,
    _y: u16,
    _screen: &mut Screen,
    _con: &AppContext
) -> Result<AppStateCmdResult, ProgramError>

fn on_double_click(
    &mut self,
    _x: u16,
    _y: u16,
    _screen: &mut Screen,
    _con: &AppContext
) -> Result<AppStateCmdResult, ProgramError>

fn on_pattern(
    &mut self,
    _pat: InputPattern,
    _con: &AppContext
) -> Result<AppStateCmdResult, ProgramError>

fn on_command(
    &mut self,
    w: &mut W,
    cc: &CmdContext,
    screen: &mut Screen
) -> Result<AppStateCmdResult, ProgramError>

change the state, does no rendering

fn get_starting_input(&self) -> String

Loading content...

Implementors

impl AppState for BrowserState[src]

fn do_pending_task(
    &mut self,
    screen: &mut Screen,
    con: &AppContext,
    dam: &mut Dam
)
[src]

do some work, totally or partially, if there's some to do. Stop as soon as the dam asks for interruption

impl AppState for HelpState[src]

Loading content...