From e9c42bca347e3a67f8d6bae953bdf0b53ce37d00 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 23 Feb 2024 12:22:29 +0100 Subject: [refactor-block] add DataBlockStream type --- src/block/block.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/block/block.rs') diff --git a/src/block/block.rs b/src/block/block.rs index 0b14bad4..3f5c4f94 100644 --- a/src/block/block.rs +++ b/src/block/block.rs @@ -7,6 +7,8 @@ use zstd::stream::Encoder; use garage_util::data::*; use garage_util::error::*; +use garage_net::stream::ByteStream; + #[derive(Debug, Serialize, Deserialize, Copy, Clone)] pub enum DataBlockHeader { Plain, @@ -25,6 +27,9 @@ pub type DataBlock = DataBlockElem; /// A path to a possibly compressed block of data pub type DataBlockPath = DataBlockElem; +/// A stream of possibly compressed block data +pub type DataBlockStream = DataBlockElem; + impl DataBlockHeader { pub fn is_compressed(&self) -> bool { matches!(self, DataBlockHeader::Compressed) -- cgit v1.2.3