pub struct Encoder { /* private fields */ }
Expand description
An in-memory encoder for streams of data.
Implementations
sourceimpl Encoder
impl Encoder
sourcepub fn with_dictionary(level: i32, dictionary: &[u8]) -> Result<Self>
pub fn with_dictionary(level: i32, dictionary: &[u8]) -> Result<Self>
Creates a new encoder initialized with the given dictionary.
sourcepub fn with_prepared_dictionary(
dictionary: &EncoderDictionary<'_>
) -> Result<Self>
pub fn with_prepared_dictionary(
dictionary: &EncoderDictionary<'_>
) -> Result<Self>
Creates a new encoder using an existing EncoderDictionary
.
sourcepub fn set_parameter(&mut self, parameter: CParameter) -> Result<()>
pub fn set_parameter(&mut self, parameter: CParameter) -> Result<()>
Sets a compression parameter for this encoder.
Trait Implementations
sourceimpl Operation for Encoder
impl Operation for Encoder
sourcefn run(
&mut self,
input: &mut InBuffer<'_>,
output: &mut OutBuffer<'_>
) -> Result<usize>
fn run(
&mut self,
input: &mut InBuffer<'_>,
output: &mut OutBuffer<'_>
) -> Result<usize>
Performs a single step of this operation. Read more
sourcefn flush(&mut self, output: &mut OutBuffer<'_>) -> Result<usize>
fn flush(&mut self, output: &mut OutBuffer<'_>) -> Result<usize>
Flushes any internal buffer, if any. Read more
Auto Trait Implementations
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl !Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more