Skip to main content

FilePickRequest

Struct FilePickRequest 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§limit: u32

At 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

Source

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.

Source

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).

Source

pub fn size_limit(&self) -> u64

The largest file read, in bytes: Self::max_size, at most MAX_PICKED_FILE_BYTES.

Source

pub fn filter(self, filter: FileFilter) -> Self

Offers the file types of filter, after those given before.

Source

pub fn multiple(&self) -> bool

Whether the user may pick several.

Source

pub fn dialog(&self) -> OpenDialog

The open dialog that shows this request on a desktop.

Trait Implementations§

Source§

impl Clone for FilePickRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilePickRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for FilePickRequest

Source§

fn default() -> Self

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

impl Eq for FilePickRequest

Source§

impl PartialEq for FilePickRequest

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FilePickRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.