From 0baaabc43e3027b1676874c536d5ade27abe14b8 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 26 Feb 2023 22:31:50 +0100 Subject: refactor(tvix/store): move blob splitting into a BlobWriter struct This will moves the chunking-as-we-receive logic that so far only lived in grpc_blobservice_wrapper.rs into a generic BlobWriter. Change-Id: Ief7d1bda3c6280129f7139de3f6c4174be2ca6ea Reviewed-on: https://cl.tvl.fyi/c/depot/+/8154 Tested-by: BuildkiteCI Reviewed-by: raitobezarius --- tvix/store/src/errors.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tvix/store/src/errors.rs') diff --git a/tvix/store/src/errors.rs b/tvix/store/src/errors.rs index 25e87c8aa239..36a4320cb3e6 100644 --- a/tvix/store/src/errors.rs +++ b/tvix/store/src/errors.rs @@ -26,3 +26,13 @@ impl From for Status { } } } + +// TODO: this should probably go somewhere else? +impl From for std::io::Error { + fn from(value: Error) -> Self { + match value { + Error::InvalidRequest(msg) => Self::new(std::io::ErrorKind::InvalidInput, msg), + Error::StorageError(msg) => Self::new(std::io::ErrorKind::Other, msg), + } + } +} -- cgit 1.4.1