Skip to main content

ResourceReader

Trait ResourceReader 

Source
pub trait ResourceReader: Send + Sync {
    // Required methods
    fn scheme(&self) -> &str;
    fn has_hierarchical_uris(&self) -> bool;
    fn is_globbable(&self) -> bool;
    fn read(&self, uri: &str) -> Result<Vec<u8>, String>;

    // Provided method
    fn list(&self, uri: &str) -> Result<Vec<PathElement>, String> { ... }
}
Expand description

A custom resource reader that can resolve resources by URI scheme.

Required Methods§

Source

fn scheme(&self) -> &str

The URI scheme this reader handles.

Source

fn has_hierarchical_uris(&self) -> bool

Whether URIs of this scheme are hierarchical.

Source

fn is_globbable(&self) -> bool

Whether this reader supports globbing.

Source

fn read(&self, uri: &str) -> Result<Vec<u8>, String>

Read the resource at the given URI.

Provided Methods§

Source

fn list(&self, uri: &str) -> Result<Vec<PathElement>, String>

List resources at the given URI (for globbing support).

Implementors§