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: Treefiltered_tree: Option<Tree>pending_pattern: InputPatterntotal_search_required: bool

Implementations

impl BrowserState[src]

pub fn new(
    path: PathBuf,
    options: TreeOptions,
    screen: Screen,
    con: &AppContext,
    dam: &Dam
) -> Result<Option<BrowserState>, TreeBuildError>
[src]

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]

pub fn go_to_parent(
    &mut self,
    screen: Screen,
    con: &AppContext,
    in_new_panel: bool
) -> CmdResult
[src]

Trait Implementations

impl PanelState for BrowserState[src]

fn with_new_options(
    &mut self,
    screen: Screen,
    change_options: &dyn Fn(&mut TreeOptions),
    in_new_panel: bool,
    con: &AppContext
) -> CmdResult
[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,