pub struct SelectFileOptions { /* private fields */ }Expand description
Options for the file picker navigation request.
Example to only allow accessing .bin files in External location:
ⓘ
let options = SelectFileOptions::default()
.with_start_location(Location::External)
.with_allowed_locations(AllowedLocations::specific(&[Location::External]))
.with_allowed_extensions(AllowedExtensions::specific(&["bin"]));Implementations§
Source§impl SelectFileOptions
impl SelectFileOptions
Sourcepub fn with_dir_selection_mode(self, dir_selection_mode: bool) -> Self
pub fn with_dir_selection_mode(self, dir_selection_mode: bool) -> Self
Enable directory selection mode.
Doesn’t show the files, only directories and allows navigating into them.
This is disabled by default.
Enabling this also enables dirs_allowed.
Sourcepub fn with_dirs_allowed(self, allow_directories: bool) -> Self
pub fn with_dirs_allowed(self, allow_directories: bool) -> Self
Allow viewing and navigating directories.
This is enabled by default.
Disabling this has no effect if dir_selection_mode is enabled.
Sourcepub fn with_search_allowed(self, allow_search: bool) -> Self
pub fn with_search_allowed(self, allow_search: bool) -> Self
Display the search bar and activates search menu.
Sourcepub fn with_multiple_selection_mode(self, multiple_selection_mode: bool) -> Self
pub fn with_multiple_selection_mode(self, multiple_selection_mode: bool) -> Self
Display the search bar and activates search menu.
This is disabled by default.
Enabling this will disable dir_selection_mode.
Sets whether hidden files are allowed to be shown.
pub fn with_start_location(self, start_location: Location) -> Self
pub fn with_allowed_locations(self, locations: AllowedLocations) -> Self
pub fn with_allowed_extensions(self, extensions: AllowedExtensions) -> Self
pub fn search_allowed(&self) -> bool
pub fn dirs_allowed(&self) -> bool
pub fn dir_selection_mode(&self) -> bool
pub fn multiple_selection_mode(&self) -> bool
pub fn start_location(&self) -> Location
pub fn allowed_locations(&self) -> &AllowedLocations
pub fn allowed_extensions(&self) -> &AllowedExtensions
pub fn from_slice(data: &[u8]) -> Option<Self>
pub fn serialize(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Archive for SelectFileOptions
impl Archive for SelectFileOptions
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§type Archived = ArchivedSelectFileOptions
type Archived = ArchivedSelectFileOptions
The archived representation of this type. Read more
Source§type Resolver = SelectFileOptionsResolver
type Resolver = SelectFileOptionsResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§impl Debug for SelectFileOptions
impl Debug for SelectFileOptions
Source§impl Default for SelectFileOptions
impl Default for SelectFileOptions
Source§impl<__D: Fallible + ?Sized> Deserialize<SelectFileOptions, __D> for Archived<SelectFileOptions>where
Location: Archive,
<Location as Archive>::Archived: Deserialize<Location, __D>,
AllowedLocations: Archive,
<AllowedLocations as Archive>::Archived: Deserialize<AllowedLocations, __D>,
AllowedExtensions: Archive,
<AllowedExtensions as Archive>::Archived: Deserialize<AllowedExtensions, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
impl<__D: Fallible + ?Sized> Deserialize<SelectFileOptions, __D> for Archived<SelectFileOptions>where
Location: Archive,
<Location as Archive>::Archived: Deserialize<Location, __D>,
AllowedLocations: Archive,
<AllowedLocations as Archive>::Archived: Deserialize<AllowedLocations, __D>,
AllowedExtensions: Archive,
<AllowedExtensions as Archive>::Archived: Deserialize<AllowedExtensions, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<SelectFileOptions, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<SelectFileOptions, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for SelectFileOptionswhere
Location: Serialize<__S>,
AllowedLocations: Serialize<__S>,
AllowedExtensions: Serialize<__S>,
bool: Serialize<__S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for SelectFileOptionswhere
Location: Serialize<__S>,
AllowedLocations: Serialize<__S>,
AllowedExtensions: Serialize<__S>,
bool: Serialize<__S>,
Auto Trait Implementations§
impl Freeze for SelectFileOptions
impl RefUnwindSafe for SelectFileOptions
impl Send for SelectFileOptions
impl Sync for SelectFileOptions
impl Unpin for SelectFileOptions
impl UnwindSafe for SelectFileOptions
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read more§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
§fn serialize_unsized(
&self,
serializer: &mut S,
) -> Result<usize, <S as Fallible>::Error>
fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>
Writes the object and returns the position of the archived type.