Skip to main content

FolderStream

Trait FolderStream 

Source
pub trait FolderStream {
    // Required methods
    fn take_ready(&self) -> Vec<Rc<dyn PickedEntry>>;
    fn is_finished(&self) -> bool;
    fn take_error(&self) -> Option<FilePickerError>;
}
Expand description

Re-export framework services (HTTP, URI, etc.) from the dedicated services crate. A folder being enumerated, yielding its files as the provider discovers them.

Walking a deep tree from a slow provider (cloud storage, a mounted WebDAV share) can take a long time, so the files are delivered incrementally rather than all at once: poll take_ready each frame to drain newly-found files, and is_finished to know when the walk is done. Callers can show the running count and start playing the first file without waiting for the rest.

Required Methods§

Source

fn take_ready(&self) -> Vec<Rc<dyn PickedEntry>>

Files discovered since the previous call (drains the ready queue).

Source

fn is_finished(&self) -> bool

Whether enumeration has finished (no more files will be discovered).

Source

fn take_error(&self) -> Option<FilePickerError>

Takes the error that ended enumeration early, if any.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§