pub struct FileExplorerBuilder { /* private fields */ }Expand description
Builder for FileExplorer.
Obtain one via FileExplorer::builder.
§Example
use tui_file_explorer::{FileExplorer, SortMode};
let explorer = FileExplorer::builder(std::env::current_dir().unwrap())
.allow_extension("iso")
.allow_extension("img")
.show_hidden(false)
.sort_mode(SortMode::SizeDesc)
.build();Implementations§
Source§impl FileExplorerBuilder
impl FileExplorerBuilder
Sourcepub fn extension_filter(self, filter: Vec<String>) -> Self
pub fn extension_filter(self, filter: Vec<String>) -> Self
Set the full extension filter list at once.
Replaces any extensions added with allow_extension.
use tui_file_explorer::FileExplorer;
let explorer = FileExplorer::builder(std::env::current_dir().unwrap())
.extension_filter(vec!["iso".into(), "img".into()])
.build();Sourcepub fn allow_extension(self, ext: impl Into<String>) -> Self
pub fn allow_extension(self, ext: impl Into<String>) -> Self
Append a single allowed extension.
Call multiple times to build up the filter:
use tui_file_explorer::FileExplorer;
let explorer = FileExplorer::builder(std::env::current_dir().unwrap())
.allow_extension("iso")
.allow_extension("img")
.build();Set whether hidden (dot-file) entries are shown on startup.
use tui_file_explorer::FileExplorer;
let explorer = FileExplorer::builder(std::env::current_dir().unwrap())
.show_hidden(true)
.build();Sourcepub fn sort_mode(self, mode: SortMode) -> Self
pub fn sort_mode(self, mode: SortMode) -> Self
Set the initial sort mode.
use tui_file_explorer::{FileExplorer, SortMode};
let explorer = FileExplorer::builder(std::env::current_dir().unwrap())
.sort_mode(SortMode::SizeDesc)
.build();Sourcepub fn build(self) -> FileExplorer
pub fn build(self) -> FileExplorer
Consume the builder and return a fully initialised FileExplorer.
Auto Trait Implementations§
impl Freeze for FileExplorerBuilder
impl RefUnwindSafe for FileExplorerBuilder
impl Send for FileExplorerBuilder
impl Sync for FileExplorerBuilder
impl Unpin for FileExplorerBuilder
impl UnsafeUnpin for FileExplorerBuilder
impl UnwindSafe for FileExplorerBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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