pub struct Model {Show 13 fields
pub path: String,
pub current_directory: String,
pub allowed_types: Vec<String>,
pub key_map: KeyMap,
pub show_permissions: bool,
pub show_size: bool,
pub show_hidden: bool,
pub dir_allowed: bool,
pub file_allowed: bool,
pub file_selected: String,
pub auto_height: bool,
pub cursor: String,
pub styles: Styles,
/* private fields */
}Expand description
Model represents a file picker.
Fields§
§path: StringPath is the path which the user has selected with the file picker.
current_directory: StringCurrentDirectory is the directory that the user is currently in.
allowed_types: Vec<String>AllowedTypes specifies which file types the user may select. If empty the user may select any file.
key_map: KeyMapThe key bindings for the file picker.
show_permissions: boolWhether to show permissions.
show_size: boolWhether to show file sizes.
Whether to show hidden files.
dir_allowed: boolWhether directories can be selected.
file_allowed: boolWhether files can be selected.
file_selected: StringThe currently selected file.
auto_height: boolWhether the height is automatically managed.
cursor: StringThe cursor string.
styles: StylesThe styles of the file picker.
Implementations§
Source§impl Model
impl Model
Sourcepub fn set_height(&mut self, h: usize)
pub fn set_height(&mut self, h: usize)
SetHeight sets the height of the file picker.
Sourcepub fn update(&mut self, msg: &dyn Msg) -> Cmd
pub fn update(&mut self, msg: &dyn Msg) -> Cmd
Update handles user interactions within the file picker model.
Sourcepub fn did_select_file(&self, msg: &dyn Msg) -> (bool, String)
pub fn did_select_file(&self, msg: &dyn Msg) -> (bool, String)
DidSelectFile returns whether a user has selected a file (on this msg).
Sourcepub fn did_select_disabled_file(&self, msg: &dyn Msg) -> (bool, String)
pub fn did_select_disabled_file(&self, msg: &dyn Msg) -> (bool, String)
DidSelectDisabledFile returns whether a user tried to select a disabled file (on this msg).
Sourcepub fn highlighted_path(&self) -> String
pub fn highlighted_path(&self) -> String
HighlightedPath returns the path of the currently highlighted file or directory.