diff options
Diffstat (limited to 'src/block/block.rs')
-rw-r--r-- | src/block/block.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<Bytes>; /// A path to a possibly compressed block of data pub type DataBlockPath = DataBlockElem<PathBuf>; +/// A stream of possibly compressed block data +pub type DataBlockStream = DataBlockElem<ByteStream>; + impl DataBlockHeader { pub fn is_compressed(&self) -> bool { matches!(self, DataBlockHeader::Compressed) |