pub struct CompressedData { /* private fields */ }Available on crate features
lz4 or zstd only.Expand description
A chunk of pre-compressed data.
Implementations§
Source§impl CompressedData
impl CompressedData
Sourcepub fn new(data: &[u8], compression: Compression) -> Result<Self>
pub fn new(data: &[u8], compression: Compression) -> Result<Self>
Compress a slice of bytes using the specified compression method.
§Errors
Returns Error::Compression if compression is Compression::None.
Sourcepub fn from_slice(slice: &[u8]) -> Self
👎Deprecated: use CompressedData::new() instead
Available on crate feature lz4 only.
pub fn from_slice(slice: &[u8]) -> Self
use CompressedData::new() instead
lz4 only.Compress a slice of bytes using LZ4.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CompressedData
impl RefUnwindSafe for CompressedData
impl Send for CompressedData
impl Sync for CompressedData
impl Unpin for CompressedData
impl UnsafeUnpin for CompressedData
impl UnwindSafe for CompressedData
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