pub struct CompressedBlob {
pub payload: Vec<u8>,
pub stored: bool,
pub original_size: usize,
pub original_hash: Vec<u8>,
}Expand description
Losslessly compressed byte data, produced by FractalCompressor::compress_bytes.
payload is a DEFLATE stream, unless stored is set — in which case
DEFLATE did not make the input smaller and payload is the original bytes verbatim.
Either way decompress_bytes recovers the input
exactly, and verifies it against original_hash before returning it.
Fields§
§payload: Vec<u8>DEFLATE stream, or the original bytes when stored is true.
stored: boolTrue when the input did not compress and payload holds it verbatim.
original_size: usizeLength of the original input, in bytes.
original_hash: Vec<u8>SHA-256 of the original input, checked on decompression.
Implementations§
Trait Implementations§
Source§impl Clone for CompressedBlob
impl Clone for CompressedBlob
Source§impl Debug for CompressedBlob
impl Debug for CompressedBlob
Source§impl<'de> Deserialize<'de> for CompressedBlob
impl<'de> Deserialize<'de> for CompressedBlob
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompressedBlob
impl RefUnwindSafe for CompressedBlob
impl Send for CompressedBlob
impl Sync for CompressedBlob
impl Unpin for CompressedBlob
impl UnsafeUnpin for CompressedBlob
impl UnwindSafe for CompressedBlob
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more