pub trait PickedEntry {
// Required methods
fn name(&self) -> String;
fn kind(&self) -> PickedKind;
fn display_path(&self) -> String;
fn read_bytes(&self) -> PickerFuture<Result<Vec<u8>, FilePickerError>>;
fn list(&self) -> PickerFuture<Result<Vec<PickedEntryRef>, FilePickerError>>;
}Expand description
An opaque handle to a picked file or folder.
This is not guaranteed to be a filesystem path. Use read_bytes to
read a file and list to enumerate a folder’s immediate children; both
go through the originating system provider.
Required Methods§
Sourcefn kind(&self) -> PickedKind
fn kind(&self) -> PickedKind
Whether this entry is a file or a folder.
Sourcefn display_path(&self) -> String
fn display_path(&self) -> String
A user-facing identifier (a path or a content:///file:// URI). Not
guaranteed to be a usable filesystem path.
Sourcefn read_bytes(&self) -> PickerFuture<Result<Vec<u8>, FilePickerError>>
fn read_bytes(&self) -> PickerFuture<Result<Vec<u8>, FilePickerError>>
Reads the full contents of a PickedKind::File entry.
Sourcefn list(&self) -> PickerFuture<Result<Vec<PickedEntryRef>, FilePickerError>>
fn list(&self) -> PickerFuture<Result<Vec<PickedEntryRef>, FilePickerError>>
Lists the immediate children of a PickedKind::Folder entry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".