pub struct ZstdCompressStream<'s> { /* private fields */ }Implementations§
Source§impl ZstdCompressStream<'_>
impl ZstdCompressStream<'_>
Sourcepub fn new(compression_level: i32, resize_by: usize) -> Result<Self, ZstdError>
pub fn new(compression_level: i32, resize_by: usize) -> Result<Self, ZstdError>
§Arguments
compression_level- The compression level to use.resize_by- The amount to resize the buffer by when it runs out of space.
Sourcepub fn multithreaded(&mut self, workers: u8) -> Result<(), ZstdError>
pub fn multithreaded(&mut self, workers: u8) -> Result<(), ZstdError>
Sets the number of worker threads to use for compression.
Can be called at any time.
Setting workers to >= 1 will make compression asynchronous.
All compression will be done in background threads.
So it’s important to call finish before dropping the stream.
pub fn write( &mut self, uncompressed: &[u8], compress_buffer: &mut Vec<u8>, ) -> Result<(), ZstdError>
pub fn finish(&mut self, compress_buffer: &mut Vec<u8>) -> Result<(), ZstdError>
Auto Trait Implementations§
impl<'s> Freeze for ZstdCompressStream<'s>
impl<'s> RefUnwindSafe for ZstdCompressStream<'s>
impl<'s> Send for ZstdCompressStream<'s>
impl<'s> Sync for ZstdCompressStream<'s>
impl<'s> Unpin for ZstdCompressStream<'s>
impl<'s> UnwindSafe for ZstdCompressStream<'s>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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