pub enum PickedFile {
Path(PathBuf),
Handle(Box<dyn FileHandle>),
Stream(Box<dyn FileStream>),
}Expand description
A file the user picked, as the system gives it.
Variants§
Path(PathBuf)
macOS, iOS, Windows and Linux: a path the app opens as any file.
Handle(Box<dyn FileHandle>)
The web, and Android where the document seeks, as it always does when writable.
Stream(Box<dyn FileStream>)
Android where the document is a pipe: read once, start to end. Read-only picks only.
Implementations§
Source§impl PickedFile
impl PickedFile
Sourcepub fn url(&self) -> String
pub fn url(&self) -> String
The URL a player, or any API that takes a URL, reads the file by, as every system’s
player does: a file: URL for a path, absolute and percent-encoded; Android’s
content: URI; the web’s blob: URL, of the file as it was when picked. A blob: URL is
made once a pick and never revoked: a player may read it after the pick is let go, so the
page keeps the file until it unloads.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PickedFile
impl !Send for PickedFile
impl !Sync for PickedFile
impl !UnwindSafe for PickedFile
impl Freeze for PickedFile
impl Unpin for PickedFile
impl UnsafeUnpin for PickedFile
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