Trait tvix_castore::fs::RootNodes

source ·
pub trait RootNodes: Send + Sync {
    // Required methods
    fn get_by_basename<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 PathComponent
    ) -> Pin<Box<dyn Future<Output = Result<Option<Node>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list(&self) -> BoxStream<'_, Result<(PathComponent, Node), Error>>;
}
Expand description

Provides an interface for looking up root nodes in tvix-castore by given a lookup key (usually the basename), and optionally allow a listing.

Required Methods§

source

fn get_by_basename<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 PathComponent ) -> Pin<Box<dyn Future<Output = Result<Option<Node>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Looks up a root CA node based on the basename of the node in the root directory of the filesystem.

source

fn list(&self) -> BoxStream<'_, Result<(PathComponent, Node), Error>>

Lists all root CA nodes in the filesystem, as a tuple of (base)name and Node. An error can be returned in case listing is not allowed.

Implementors§

source§

impl<T> RootNodes for T

Implements RootNodes for something deref’ing to a BTreeMap of Nodes, where the key is the node name.