pub struct OpenFiles { /* private fields */ }Expand description
A native “open files” picker that lets the user choose several files at once. .await
(or .present().await) resolves to the chosen FileUrls in the picker’s order, or an
empty Vec if the user cancels.
ⓘ
let tracks = open_files().filter("Audio", &["mp3", "flac"]).await;
for track in &tracks { library.add(track.read()?); }Implementations§
Source§impl OpenFiles
impl OpenFiles
Sourcepub fn title<M>(self, t: impl IntoText<M>) -> Self
pub fn title<M>(self, t: impl IntoText<M>) -> Self
Override the picker’s title (localizable via tr()).
Sourcepub fn filter(self, name: impl Into<String>, extensions: &[&str]) -> Self
pub fn filter(self, name: impl Into<String>, extensions: &[&str]) -> Self
Add a named file-type filter, e.g. .filter("Audio", &["mp3", "flac"]). No filter = all files.
pub async fn present(self) -> Vec<FileUrl>
Trait Implementations§
Source§impl IntoFuture for OpenFiles
impl IntoFuture for OpenFiles
Auto Trait Implementations§
impl Forget for OpenFiles
impl Freeze for OpenFiles
impl Move for OpenFiles
impl RefUnwindSafe for OpenFiles
impl Send for OpenFiles
impl Sync for OpenFiles
impl Unpin for OpenFiles
impl UnsafeUnpin for OpenFiles
impl UnwindSafe for OpenFiles
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more