#[non_exhaustive]pub struct FilePickRequest {
pub limit: u32,
pub filters: Vec<FileFilter>,
pub max_size: Option<u64>,
}Expand description
What the app asked a pick of files for, checked: what the platform’s picker shows.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.limit: u32At most this many files (1 for a single pick), never more than
MAX_PICKED.
filters: Vec<FileFilter>The file types offered, the first chosen; none: any file. iOS, Android and the web take one list of all their extensions. A filter is what the picker offers, not a promise: a system’s picker may let other files through.
max_size: Option<u64>The largest file read, in bytes: a larger one answers with its name
and size only (PickedStatus::TooLarge). None:
MAX_PICKED_FILE_BYTES, which also caps a larger one.
Implementations§
Source§impl FilePickRequest
impl FilePickRequest
Sourcepub fn new(multiple: bool, limit: u32) -> Self
pub fn new(multiple: bool, limit: u32) -> Self
A request for one file (multiple: false) or up to limit of them
(0: as many as MAX_PICKED), of any type.
Sourcepub fn max_size(self, bytes: u64) -> Self
pub fn max_size(self, bytes: u64) -> Self
Reads files of at most bytes bytes; a larger one answers with its
name and size only (PickedStatus::TooLarge).
Sourcepub fn size_limit(&self) -> u64
pub fn size_limit(&self) -> u64
The largest file read, in bytes: Self::max_size, at most
MAX_PICKED_FILE_BYTES.
Sourcepub fn filter(self, filter: FileFilter) -> Self
pub fn filter(self, filter: FileFilter) -> Self
Offers the file types of filter, after those given before.
Sourcepub fn dialog(&self) -> OpenDialog
pub fn dialog(&self) -> OpenDialog
The open dialog that shows this request on a desktop.