pub struct BlockCompressor { /* private fields */ }Implementations§
Source§impl BlockCompressor
impl BlockCompressor
pub fn none() -> Self
pub fn lz4() -> Self
pub fn zstd(level: i32) -> Self
pub fn codec(&self) -> CompressionCodec
pub fn compress(&self, data: &[u8]) -> Vec<u8> ⓘ
Sourcepub fn decompress(&self, data: &[u8]) -> AilakeResult<Vec<u8>>
pub fn decompress(&self, data: &[u8]) -> AilakeResult<Vec<u8>>
Decompresses data written by compress with the same codec.
Returns an error on truncated/corrupted input instead of silently substituting the still-compressed bytes as if they were the decompressed payload — a caller has no way to detect corruption if a failed decompress looks like success.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockCompressor
impl RefUnwindSafe for BlockCompressor
impl Send for BlockCompressor
impl Sync for BlockCompressor
impl Unpin for BlockCompressor
impl UnsafeUnpin for BlockCompressor
impl UnwindSafe for BlockCompressor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more