Skip to main content

PklModuleReader

Trait PklModuleReader 

Source
pub trait PklModuleReader {
    // Required methods
    fn scheme(&self) -> &str;
    fn is_local(&self) -> bool;
    fn read(&self, uri: &str) -> Result<String, Box<dyn Error>>;
    fn list(&self, uri: &str) -> Result<Vec<PathElements>, Box<dyn Error>>;

    // Provided methods
    fn has_hierarchical_uris(&self) -> bool { ... }
    fn is_globbable(&self) -> bool { ... }
}

Required Methods§

Source

fn scheme(&self) -> &str

Scheme returns the scheme part of the URL that this reader can read. The value should be the URI scheme up to (not including) :

Source

fn is_local(&self) -> bool

Tells whether the module is local to the system.

A local resource that [hasHierarchicalUris] supports triple-dot imports.

Source

fn read(&self, uri: &str) -> Result<String, Box<dyn Error>>

Read the contents of the module at the given URI.

Source

fn list(&self, uri: &str) -> Result<Vec<PathElements>, Box<dyn Error>>

List the contents of the module at the given URI.

Provided Methods§

Source

fn has_hierarchical_uris(&self) -> bool

Tells whether the path part of ths URI has a hier-part.

An example of a hierarchical URI is file:///path/to/my/file, where /path/to/my/file designates a nested path through the / character.

An example of a non-hierarchical URI is pkl.base, where the base does not denote any form of hierarchy.

Source

fn is_globbable(&self) -> bool

Tells whether this reader supports globbing.

Implementors§