HelpState

Struct HelpState 

Source
pub struct HelpState {
    pub scroll: usize,
    pub text_area: Area,
    /* private fields */
}
Expand description

an application state dedicated to help

Fields§

§scroll: usize§text_area: Area

Implementations§

Source§

impl HelpState

Source

pub fn new( tree_options: TreeOptions, _screen: Screen, con: &AppContext, ) -> HelpState

Trait Implementations§

Source§

impl PanelState for HelpState

Source§

fn get_type(&self) -> PanelStateType

Source§

fn set_mode(&mut self, mode: Mode)

Source§

fn get_mode(&self) -> Mode

Source§

fn selected_path(&self) -> Option<&Path>

Source§

fn tree_options(&self) -> TreeOptions

Source§

fn with_new_options( &mut self, _screen: Screen, change_options: &dyn Fn(&mut TreeOptions) -> &'static str, _in_new_panel: bool, _con: &AppContext, ) -> CmdResult

Build a cmdResult in response to a command being a change of tree options. This may or not be a new state. Read more
Source§

fn selection(&self) -> Option<Selection<'_>>

Source§

fn refresh(&mut self, _screen: Screen, _con: &AppContext) -> Command

Source§

fn on_pattern( &mut self, pat: InputPattern, _app_state: &AppState, _con: &AppContext, ) -> Result<CmdResult, ProgramError>

Source§

fn display( &mut self, w: &mut W, disc: &DisplayContext<'_>, ) -> Result<(), ProgramError>

Source§

fn on_internal( &mut self, w: &mut W, invocation_parser: Option<&InvocationParser>, internal_exec: &InternalExecution, input_invocation: Option<&VerbInvocation>, trigger_type: TriggerType<'_>, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

execute the internal with the optional given invocation. Read more
Source§

fn clear_pending(&mut self)

called on start of on_command, remove the pending task
Source§

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

Source§

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

Source§

fn on_mode_verb(&mut self, mode: Mode, con: &AppContext) -> CmdResult

Source§

fn on_internal_generic( &mut self, _w: &mut W, invocation_parser: Option<&InvocationParser>, internal_exec: &InternalExecution, input_invocation: Option<&VerbInvocation>, _trigger_type: TriggerType<'_>, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

a generic implementation of on_internal which may be called by states when they don’t have a specific behavior to execute
Source§

fn stage( &self, app_state: &mut AppState, cc: &CmdContext<'_>, con: &AppContext, ) -> CmdResult

Source§

fn unstage( &self, app_state: &mut AppState, cc: &CmdContext<'_>, _con: &AppContext, ) -> CmdResult

Source§

fn toggle_stage( &self, app_state: &mut AppState, cc: &CmdContext<'_>, con: &AppContext, ) -> CmdResult

Source§

fn execute_verb( &mut self, w: &mut W, verb: &Verb, invocation: Option<&VerbInvocation>, trigger_type: TriggerType<'_>, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

Source§

fn execute_external( &mut self, w: &mut W, verb: &Verb, external_execution: &ExternalExecution, invocation: Option<&VerbInvocation>, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

Source§

fn execute_sequence( &mut self, _w: &mut W, verb: &Verb, seq_ex: &SequenceExecution, invocation: Option<&VerbInvocation>, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

Source§

fn on_command( &mut self, w: &mut W, app_state: &mut AppState, cc: &CmdContext<'_>, ) -> Result<CmdResult, ProgramError>

change the state, does no rendering
Source§

fn open_preview( &mut self, preferred_mode: Option<PreviewMode>, close_if_open: bool, cc: &CmdContext<'_>, ) -> CmdResult

return a cmdresult asking for the opening of a preview
Source§

fn tree_root(&self) -> Option<&Path>

must return None if the state doesn’t display a file tree
Source§

fn watchable_paths(&self) -> Vec<PathBuf>

Source§

fn sel_info<'c>(&'c self, _app_state: &'c AppState) -> SelInfo<'c>

Source§

fn has_at_least_one_selection(&self, _app_state: &AppState) -> bool

Source§

fn do_pending_task( &mut self, _app_state: &mut AppState, _screen: Screen, _con: &AppContext, _dam: &mut Dam, ) -> Result<(), ProgramError>

Source§

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

Source§

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

return the flags to display
Source§

fn get_starting_input(&self) -> String

Source§

fn set_selected_path(&mut self, _path: PathBuf, _con: &AppContext)

Source§

fn no_verb_status( &self, _has_previous_state: bool, _con: &AppContext, _width: usize, ) -> Status

return the status which should be used when there’s no verb edited
Source§

fn get_status( &self, app_state: &AppState, cc: &CmdContext<'_>, has_previous_state: bool, width: usize, ) -> Status

Source§

fn get_verb_status( &self, verb: &Verb, invocation: &VerbInvocation, sel_info: SelInfo<'_>, cc: &CmdContext<'_>, app_state: &AppState, ) -> Status

Auto Trait Implementations§

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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