Skip to main content

PickedEntry

Trait PickedEntry 

Source
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§

Source

fn name(&self) -> String

The display name (last path/URI component).

Source

fn kind(&self) -> PickedKind

Whether this entry is a file or a folder.

Source

fn display_path(&self) -> String

A user-facing identifier (a path or a content:///file:// URI). Not guaranteed to be a usable filesystem path.

Source

fn read_bytes( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, FilePickerError>>>>

Reads the full contents of a PickedKind::File entry.

Source

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".

Implementors§