about summary refs log tree commit diff
path: root/tvix/store/src/nar/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/nar/mod.rs')
-rw-r--r--tvix/store/src/nar/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tvix/store/src/nar/mod.rs b/tvix/store/src/nar/mod.rs
index a3a8677d92a6..d9e0c8143b5a 100644
--- a/tvix/store/src/nar/mod.rs
+++ b/tvix/store/src/nar/mod.rs
@@ -1,8 +1,11 @@
+use crate::proto;
 use data_encoding::BASE64;
 use thiserror::Error;
 
+mod non_caching_calculation_service;
 mod renderer;
 
+pub use non_caching_calculation_service::NonCachingNARCalculationService;
 pub use renderer::NARRenderer;
 
 /// Errors that can encounter while rendering NARs.
@@ -23,3 +26,11 @@ pub enum RenderError {
     #[error("failure using the NAR writer: {0}")]
     NARWriterError(std::io::Error),
 }
+
+/// The base trait for something calculating NARs, and returning their size and sha256.
+pub trait NARCalculationService {
+    fn calculate_nar(
+        &self,
+        root_node: proto::node::Node,
+    ) -> Result<proto::CalculateNarResponse, RenderError>;
+}