Skip to main content

SourceTree

Trait SourceTree 

Source
pub trait SourceTree {
    // Required methods
    fn list(&self, root: &Path) -> Result<Vec<String>>;
    fn read(&self, key: &str) -> Result<String>;
}
Expand description

A source of .brink files: enumerate what exists under a root, and read any key that enumeration returned.

See the module docs for the full contract. Implementations must return list() results sorted by key, regardless of what order the underlying storage (filesystem, git tree, in-memory map) happens to iterate in.

Required Methods§

Source

fn list(&self, root: &Path) -> Result<Vec<String>>

Enumerate every source key under root, sorted deterministically by key.

Source

fn read(&self, key: &str) -> Result<String>

Read the source text for key (a key previously returned by list).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§