Skip to main content

FileSource

Trait FileSource 

Source
pub trait FileSource:
    Send
    + Sync
    + Debug {
    // Required methods
    fn id(&self) -> &str;
    fn list(&self, place: &Path, options: &ListOptions) -> Listing;

    // Provided methods
    fn can_watch(&self) -> bool { ... }
    fn watch(&self, _place: &Path) -> Result<(), SourceError> { ... }
}
Expand description

Where a browser’s entries come from: a file system, a camera card, a catalogue. Entries are paged and streamed.

Required Methods§

Source

fn id(&self) -> &str

A stable id, for persistence and the collector.

Source

fn list(&self, place: &Path, options: &ListOptions) -> Listing

Starts a listing of place; a refresh is a new listing.

Provided Methods§

Source

fn can_watch(&self) -> bool

Whether FileSource::watch means something here.

Source

fn watch(&self, _place: &Path) -> Result<(), SourceError>

Asks to be told when place changes, through the listing’s pages.

Implementors§