Struct broot::browser::BrowserState [−][src]
pub struct BrowserState { pub tree: Tree, pub filtered_tree: Option<Tree>, pub pending_pattern: InputPattern, pub total_search_required: bool, // some fields omitted }
An application state dedicated to displaying a tree. It’s the first and main screen of broot.
Fields
tree: Tree
filtered_tree: Option<Tree>
pending_pattern: InputPattern
total_search_required: bool
Implementations
impl BrowserState
[src]
impl BrowserState
[src]pub fn new(
path: PathBuf,
options: TreeOptions,
screen: Screen,
con: &AppContext,
dam: &Dam
) -> Result<Option<BrowserState>, TreeBuildError>
[src]
path: PathBuf,
options: TreeOptions,
screen: Screen,
con: &AppContext,
dam: &Dam
) -> Result<Option<BrowserState>, TreeBuildError>
build a new tree state if there’s no error and there’s no cancellation.
In case of cancellation return Ok(None)
. If dam is unlimited()
then
this can’t be returned.
pub fn root(&self) -> &Path
[src]
pub fn page_height(screen: Screen) -> i32
[src]
pub fn displayed_tree(&self) -> &Tree
[src]
return a reference to the currently displayed tree, which is the filtered tree if there’s one, the base tree if not.
pub fn displayed_tree_mut(&mut self) -> &mut Tree
[src]
return a mutable reference to the currently displayed tree, which is the filtered tree if there’s one, the base tree if not.
pub fn open_selection_stay_in_broot(
&mut self,
screen: Screen,
con: &AppContext,
in_new_panel: bool,
keep_pattern: bool
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
screen: Screen,
con: &AppContext,
in_new_panel: bool,
keep_pattern: bool
) -> Result<CmdResult, ProgramError>
pub fn go_to_parent(
&mut self,
screen: Screen,
con: &AppContext,
in_new_panel: bool
) -> CmdResult
[src]
&mut self,
screen: Screen,
con: &AppContext,
in_new_panel: bool
) -> CmdResult
Trait Implementations
impl PanelState for BrowserState
[src]
impl PanelState for BrowserState
[src]fn get_type(&self) -> PanelStateType
[src]
fn set_mode(&mut self, mode: Mode)
[src]
fn get_mode(&self) -> Mode
[src]
fn get_pending_task(&self) -> Option<&'static str>
[src]
fn selected_path(&self) -> Option<&Path>
[src]
fn selection(&self) -> Option<Selection<'_>>
[src]
fn tree_options(&self) -> TreeOptions
[src]
fn with_new_options(
&mut self,
screen: Screen,
change_options: &dyn Fn(&mut TreeOptions),
in_new_panel: bool,
con: &AppContext
) -> CmdResult
[src]
&mut self,
screen: Screen,
change_options: &dyn Fn(&mut TreeOptions),
in_new_panel: bool,
con: &AppContext
) -> CmdResult
build a cmdResult asking for the addition of a new state being a browser state similar to the current one but with different options
fn clear_pending(&mut self)
[src]
fn on_click(
&mut self,
_x: u16,
y: u16,
_screen: Screen,
_con: &AppContext
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
_x: u16,
y: u16,
_screen: Screen,
_con: &AppContext
) -> Result<CmdResult, ProgramError>
fn on_double_click(
&mut self,
_x: u16,
y: u16,
screen: Screen,
con: &AppContext
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
_x: u16,
y: u16,
screen: Screen,
con: &AppContext
) -> Result<CmdResult, ProgramError>
fn on_pattern(
&mut self,
pat: InputPattern,
_app_state: &AppState,
_con: &AppContext
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
pat: InputPattern,
_app_state: &AppState,
_con: &AppContext
) -> Result<CmdResult, ProgramError>
fn on_internal(
&mut self,
w: &mut W,
internal_exec: &InternalExecution,
input_invocation: Option<&VerbInvocation>,
trigger_type: TriggerType,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
w: &mut W,
internal_exec: &InternalExecution,
input_invocation: Option<&VerbInvocation>,
trigger_type: TriggerType,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
fn no_verb_status(&self, has_previous_state: bool, con: &AppContext) -> Status
[src]
fn do_pending_task(&mut self, screen: 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
fn display(
&mut self,
w: &mut W,
disc: &DisplayContext<'_>
) -> Result<(), ProgramError>
[src]
&mut self,
w: &mut W,
disc: &DisplayContext<'_>
) -> Result<(), ProgramError>
fn refresh(&mut self, screen: Screen, con: &AppContext) -> Command
[src]
fn get_flags(&self) -> Vec<Flag>
[src]
fn get_starting_input(&self) -> String
[src]
fn on_mode_verb(&mut self, mode: Mode, con: &AppContext) -> CmdResult
[src]
fn on_internal_generic(
&mut self,
_w: &mut W,
internal_exec: &InternalExecution,
input_invocation: Option<&VerbInvocation>,
_trigger_type: TriggerType,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
_w: &mut W,
internal_exec: &InternalExecution,
input_invocation: Option<&VerbInvocation>,
_trigger_type: TriggerType,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
fn stage(
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
con: &AppContext
) -> CmdResult
[src]
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
con: &AppContext
) -> CmdResult
fn unstage(
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
_con: &AppContext
) -> CmdResult
[src]
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
_con: &AppContext
) -> CmdResult
fn toggle_stage(
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
con: &AppContext
) -> CmdResult
[src]
&self,
app_state: &mut AppState,
cc: &CmdContext<'_>,
con: &AppContext
) -> CmdResult
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>
[src]
&mut self,
w: &mut W,
verb: &Verb,
invocation: Option<&VerbInvocation>,
trigger_type: TriggerType,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
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>
[src]
&mut self,
w: &mut W,
verb: &Verb,
external_execution: &ExternalExecution,
invocation: Option<&VerbInvocation>,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
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>
[src]
&mut self,
_w: &mut W,
verb: &Verb,
seq_ex: &SequenceExecution,
invocation: Option<&VerbInvocation>,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
fn on_command(
&mut self,
w: &mut W,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
[src]
&mut self,
w: &mut W,
app_state: &mut AppState,
cc: &CmdContext<'_>
) -> Result<CmdResult, ProgramError>
fn open_preview(
&mut self,
prefered_mode: Option<PreviewMode>,
close_if_open: bool,
cc: &CmdContext<'_>
) -> CmdResult
[src]
&mut self,
prefered_mode: Option<PreviewMode>,
close_if_open: bool,
cc: &CmdContext<'_>
) -> CmdResult
fn sel_info<'c>(&'c self, _app_state: &'c AppState) -> SelInfo<'c>
[src]
fn has_at_least_one_selection(&self, _app_state: &AppState) -> bool
[src]
fn set_selected_path(&mut self, _path: PathBuf, _con: &AppContext)
[src]
fn get_status(
&self,
app_state: &AppState,
cc: &CmdContext<'_>,
has_previous_state: bool
) -> Status
[src]
&self,
app_state: &AppState,
cc: &CmdContext<'_>,
has_previous_state: bool
) -> Status
fn get_verb_status(
&self,
verb: &Verb,
invocation: &VerbInvocation,
sel_info: SelInfo<'_>,
cc: &CmdContext<'_>
) -> Status
[src]
&self,
verb: &Verb,
invocation: &VerbInvocation,
sel_info: SelInfo<'_>,
cc: &CmdContext<'_>
) -> Status
Auto Trait Implementations
impl RefUnwindSafe for BrowserState
impl RefUnwindSafe for BrowserState
impl Send for BrowserState
impl Send for BrowserState
impl Sync for BrowserState
impl Sync for BrowserState
impl Unpin for BrowserState
impl Unpin for BrowserState
impl UnwindSafe for BrowserState
impl UnwindSafe for BrowserState