From 27ff98000b0cdf0ed30eb8837c7d44cd3e79d32f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 25 May 2023 17:52:08 +0300 Subject: feat(tvix/store): eliminate generics in BlobStore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To construct various stores at runtime, we need to eliminate associated types from the BlobService trait, and return Box instead of specific types. This also means we can't consume self in the close() method, so everything we write to is put in an Option<>, and during the first close we take from there. Change-Id: Ia523b6ab2f2a5276f51cb5d17e81a5925bce69b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8647 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/store/src/nar/renderer.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tvix/store/src/nar/renderer.rs') diff --git a/tvix/store/src/nar/renderer.rs b/tvix/store/src/nar/renderer.rs index c10f2ddf52fa..a9a6d989e1b8 100644 --- a/tvix/store/src/nar/renderer.rs +++ b/tvix/store/src/nar/renderer.rs @@ -11,14 +11,13 @@ use tracing::warn; /// A NAR renderer, using a blob_service, chunk_service and directory_service /// to render a NAR to a writer. -#[derive(Clone)] -pub struct NARRenderer { - blob_service: BS, +pub struct NARRenderer { + blob_service: Box, directory_service: DS, } -impl NARRenderer { - pub fn new(blob_service: BS, directory_service: DS) -> Self { +impl NARRenderer { + pub fn new(blob_service: Box, directory_service: DS) -> Self { Self { blob_service, directory_service, -- cgit 1.4.1