pub struct FileChooser {
pub multiple: bool,
pub accept: Vec<String>,
pub files: Vec<FileInput>,
}Expand description
File chooser for handling file input elements
Fields§
§multiple: boolWhether multiple files can be selected
accept: Vec<String>Accepted file types (MIME types or extensions)
files: Vec<FileInput>Selected files
Implementations§
Source§impl FileChooser
impl FileChooser
Sourcepub fn accept(self, types: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn accept(self, types: impl IntoIterator<Item = impl Into<String>>) -> Self
Set accepted file types
Sourcepub fn set_files(&mut self, files: impl IntoIterator<Item = FileInput>)
pub fn set_files(&mut self, files: impl IntoIterator<Item = FileInput>)
Set a single file
Sourcepub fn set_input_files(&mut self, paths: &[impl AsRef<Path>])
pub fn set_input_files(&mut self, paths: &[impl AsRef<Path>])
Set files from paths
Sourcepub fn is_accepted(&self, file: &FileInput) -> bool
pub fn is_accepted(&self, file: &FileInput) -> bool
Check if file type is accepted
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Get file count
Trait Implementations§
Source§impl Clone for FileChooser
impl Clone for FileChooser
Source§fn clone(&self) -> FileChooser
fn clone(&self) -> FileChooser
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileChooser
impl Debug for FileChooser
Auto Trait Implementations§
impl Freeze for FileChooser
impl RefUnwindSafe for FileChooser
impl Send for FileChooser
impl Sync for FileChooser
impl Unpin for FileChooser
impl UnsafeUnpin for FileChooser
impl UnwindSafe for FileChooser
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
Mutably borrows from an owned value. Read more