Be aware: Foundation will NEVER ask for your seed words, device PIN, or call you unexpectedly. If anyone does, it's a scam.

Struct

SelectFileOptions

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

impl SelectFileOptions

pub fn with_dir_selection_mode(self, dir_selection_mode: bool) -> Self

Permission: not needed

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.

pub fn with_dirs_allowed(self, allow_directories: bool) -> Self

Permission: not needed

Allow viewing and navigating directories. This is enabled by default. Disabling this has no effect if dir_selection_mode is enabled.

pub fn with_search_allowed(self, allow_search: bool) -> Self

Permission: not needed

Display the search bar and activates search menu.

pub fn with_multiple_selection_mode(self, multiple_selection_mode: bool) -> Self

Permission: not needed

Display the search bar and activates search menu. This is disabled by default. Enabling this will disable dir_selection_mode.

pub fn with_hidden_allowed(self, hidden_allowed: bool) -> Self

Permission: not needed

Sets whether hidden files are allowed to be shown.

pub fn with_start_location(self, start_location: Location) -> Self

Permission: not needed

pub fn with_allowed_locations(self, locations: AllowedLocations) -> Self

Permission: not needed

pub fn with_allowed_extensions(self, extensions: AllowedExtensions) -> Self

Permission: not needed

pub fn search_allowed(&self) -> bool

Permission: not needed

pub fn dirs_allowed(&self) -> bool

Permission: not needed

pub fn hidden_allowed(&self) -> bool

Permission: not needed

pub fn dir_selection_mode(&self) -> bool

Permission: not needed

pub fn multiple_selection_mode(&self) -> bool

Permission: not needed

pub fn start_location(&self) -> Location

Permission: not needed

pub fn allowed_locations(&self) -> &AllowedLocations

Permission: not needed

pub fn allowed_extensions(&self) -> &AllowedExtensions

Permission: not needed

pub fn from_slice(data: &[u8]) -> Option<Self>

Permission: not needed

pub fn serialize(&self) -> Vec<u8> ⓘ

Permission: not needed

Trait Implementations

impl Archive for SelectFileOptions
where Location: Archive, AllowedLocations: Archive, AllowedExtensions: Archive, bool: Archive,

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 more

type Archived = ArchivedSelectFileOptions

The archived representation of this type. Read more

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.

fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)

Creates the archived version of this value at the given position and writes it to the given output. Read more

impl Debug for SelectFileOptions

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

impl Default for SelectFileOptions

fn default() -> Self

Returns the “default value” for a type. Read more

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

fn deserialize( &self, deserializer: &mut __D, ) -> Result<SelectFileOptions, <__D as Fallible>::Error>

Deserializes using the given deserializer

impl<__S: Fallible + ?Sized> Serialize<__S> for SelectFileOptions
where Location: Serialize<__S>, AllowedLocations: Serialize<__S>, AllowedExtensions: Serialize<__S>, bool: Serialize<__S>,

fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, <__S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.

Auto Trait Implementations

impl Freeze for SelectFileOptions

impl RefUnwindSafe for SelectFileOptions

impl Send for SelectFileOptions

impl Sync for SelectFileOptions

impl Unpin for SelectFileOptions

impl UnsafeUnpin for SelectFileOptions

impl UnwindSafe for SelectFileOptions