pub trait PickedEntry {
// Required methods
fn name(&self) -> String;
fn kind(&self) -> PickedKind;
fn display_path(&self) -> String;
fn read_bytes(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilePickerError>>>>;
fn list(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Rc<dyn PickedEntry>>, FilePickerError>>>>;
}Expand description
Re-export framework services (HTTP, URI, etc.) from the dedicated services crate. 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,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilePickerError>>>>
fn read_bytes( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilePickerError>>>>
Reads the full contents of a PickedKind::File entry.
Sourcefn list(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Rc<dyn PickedEntry>>, FilePickerError>>>>
fn list( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Rc<dyn PickedEntry>>, 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".