diff --git a/tvix/store/src/pathinfoservice/mod.rs b/tvix/store/src/pathinfoservice/mod.rs index 55ada92b7..1f52d20ca 100644 --- a/tvix/store/src/pathinfoservice/mod.rs +++ b/tvix/store/src/pathinfoservice/mod.rs @@ -50,3 +50,28 @@ pub trait PathInfoService: Send + Sync { /// [async_trait] generates, but for streams instead of futures. fn list(&self) -> BoxStream<'static, Result>; } + +#[async_trait] +impl PathInfoService for A +where + A: AsRef + Send + Sync, +{ + async fn get(&self, digest: [u8; 20]) -> Result, Error> { + self.as_ref().get(digest).await + } + + async fn put(&self, path_info: PathInfo) -> Result { + self.as_ref().put(path_info).await + } + + async fn calculate_nar( + &self, + root_node: &castorepb::node::Node, + ) -> Result<(u64, [u8; 32]), Error> { + self.as_ref().calculate_nar(root_node).await + } + + fn list(&self) -> BoxStream<'static, Result> { + self.as_ref().list() + } +}