summaryrefslogtreecommitdiffstats
path: root/vendor/ruzstd/src/blocks/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruzstd/src/blocks/block.rs')
-rw-r--r--vendor/ruzstd/src/blocks/block.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/ruzstd/src/blocks/block.rs b/vendor/ruzstd/src/blocks/block.rs
new file mode 100644
index 000000000..9c872ebf9
--- /dev/null
+++ b/vendor/ruzstd/src/blocks/block.rs
@@ -0,0 +1,25 @@
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum BlockType {
+ Raw,
+ RLE,
+ Compressed,
+ Reserved,
+}
+
+impl std::fmt::Display for BlockType {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+ match self {
+ BlockType::Compressed => write!(f, "Compressed"),
+ BlockType::Raw => write!(f, "Raw"),
+ BlockType::RLE => write!(f, "RLE"),
+ BlockType::Reserved => write!(f, "Reserverd"),
+ }
+ }
+}
+
+pub struct BlockHeader {
+ pub last_block: bool,
+ pub block_type: BlockType,
+ pub decompressed_size: u32,
+ pub content_size: u32,
+}