pub struct Picker { /* private fields */ }Expand description
The picker’s state: the folder shown, its entries, the selection.
Implementations§
Source§impl Picker
impl Picker
Sourcepub fn new(kinds: Vec<FileKind>, start: impl Into<PathBuf>) -> Self
pub fn new(kinds: Vec<FileKind>, start: impl Into<PathBuf>) -> Self
A picker for kinds showing start (or, if it cannot be read, home, then the root).
Sourcepub fn with_recent(self, recent: Vec<PathBuf>) -> Self
pub fn with_recent(self, recent: Vec<PathBuf>) -> Self
The same picker listing recent files under Places (the app’s recent files, newest first).
Sourcepub fn entries(&self) -> &[Entry]
pub fn entries(&self) -> &[Entry]
What is shown of the folder: folders first, then the rest, each by name (case ignored).
Sourcepub fn error(&self) -> Option<&str>
pub fn error(&self) -> Option<&str>
Why the last folder could not be shown (the picker stays where it was).
Sourcepub fn set_show_all(&mut self, on: bool)
pub fn set_show_all(&mut self, on: bool)
Lists, or hides, the files the app does not open.
Sourcepub fn selected_entry(&self) -> Option<&Entry>
pub fn selected_entry(&self) -> Option<&Entry>
The selected entry.
Sourcepub fn openable(&self) -> Option<PathBuf>
pub fn openable(&self) -> Option<PathBuf>
What the Open button would open now: the selected entry, if the app opens it.
Sourcepub fn crumbs(&self) -> Vec<(String, PathBuf)>
pub fn crumbs(&self) -> Vec<(String, PathBuf)>
The breadcrumb: each folder from the root down to the one shown, with its path.
Sourcepub fn enter(&mut self, dir: &Path) -> Result<(), String>
pub fn enter(&mut self, dir: &Path) -> Result<(), String>
Shows the folder dir. When it cannot be read the picker stays where it was and says why.
Sourcepub fn refresh(&mut self)
pub fn refresh(&mut self)
Reads the folder again (after a change on disk), keeping the selection by path.
Sourcepub fn activate(&mut self, i: usize) -> Option<PathBuf>
pub fn activate(&mut self, i: usize) -> Option<PathBuf>
What a double click (or Enter) on entry i does: a folder is entered (None); something
the app opens is returned, to open; anything else does nothing.
Sourcepub fn kind_of(&self, name: &str, is_dir: bool) -> EntryKind
pub fn kind_of(&self, name: &str, is_dir: bool) -> EntryKind
The kind of name, given whether it is a folder.
Sourcepub fn opens_line(&self) -> String
pub fn opens_line(&self) -> String
A line for the footer: what the app opens here (“Opens: Recording (.nwb), Zarr store (.zarr)”).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Picker
impl Freeze for Pickerwhere
*const u8 is !null: Freeze,
PhantomData<FileKind>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Entry>: Freeze,
PhantomData<PathBuf>: Freeze,
impl Move for Picker
impl RefUnwindSafe for Picker
impl Send for Pickerwhere
RawVecInner: Send,
impl Sync for Pickerwhere
RawVecInner: Sync,
impl Unpin for Picker
impl UnsafeUnpin for Pickerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<FileKind>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Entry>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
impl UnwindSafe for Pickerwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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