pub struct Lz4;Available on crate feature
lz4 only.Expand description
The LZ4 codec (via lz4_flex).
Implementations§
Source§impl Lz4
impl Lz4
Sourcepub fn compress(&self, input: &[u8]) -> Vec<u8> ⓘ
Available on crate feature enc only.
pub fn compress(&self, input: &[u8]) -> Vec<u8> ⓘ
enc only.Compress input.
Sourcepub fn decompress(
&self,
input: &[u8],
orig_len: usize,
) -> Result<Vec<u8>, Error>
Available on crate feature dec only.
pub fn decompress( &self, input: &[u8], orig_len: usize, ) -> Result<Vec<u8>, Error>
dec only.Decompress input, which must expand to exactly orig_len bytes.
§Errors
Returns Error::Corrupt if input is not a valid LZ4 block, if it
expands to a length other than orig_len, or if orig_len is more
than this target can allocate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lz4
impl RefUnwindSafe for Lz4
impl Send for Lz4
impl Sync for Lz4
impl Unpin for Lz4
impl UnsafeUnpin for Lz4
impl UnwindSafe for Lz4
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