Enum DeflateFlush
pub enum DeflateFlush
Variants
-
NoFlush = 0 if flush is set to
NoFlush, that allows deflate to decide how much data to accumulate before producing output, in order to maximize compression.-
PartialFlush = 1 If flush is set to
PartialFlush, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed codes block.-
SyncFlush = 2 If the parameter flush is set to
SyncFlush, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff).-
FullFlush = 3 If flush is set to
FullFlush, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. UsingFullFlushtoo often can seriously degrade compression.-
Finish = 4 If the parameter flush is set to
Finish, pending input is processed, pending output is flushed and deflate returns withStreamEndif there was enough output space. If deflate returns withOkorBufError, this function must be called again withFinishand more output space (updated avail_out) but no more input data, until it returns withStreamEndor an error. After deflate has returnedStreamEnd, the only possible operations on the stream are deflateReset or deflateEnd.Finishcan be used in the first deflate call after deflateInit if all the compression is to be done in a single step. In order to complete in one call, avail_out must be at least the value returned by deflateBound (see below). Then deflate is guaranteed to returnStreamEnd. If not enough output space is provided, deflate will not returnStreamEnd, and it must be called again as described above.-
Block = 5 If flush is set to
Block, a deflate block is completed and emitted, as forSyncFlush, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks.
Trait Implementations
impl Clone for DeflateFlush
fn clone(&self) -> Self
impl Copy for DeflateFlush
impl Debug for DeflateFlush
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for DeflateFlush
fn default() -> Self
impl Eq for DeflateFlush
impl PartialEq for DeflateFlush
fn eq(&self, other: &Self) -> bool
impl StructuralPartialEq for DeflateFlush
impl TryFrom<i32> for DeflateFlush
type Error = ();fn try_from(value: i32) -> Result<Self, Self::Error>
Auto Trait Implementations
impl Freeze for DeflateFlush
impl RefUnwindSafe for DeflateFlush
impl Send for DeflateFlush
impl Sync for DeflateFlush
impl Unpin for DeflateFlush
impl UnsafeUnpin for DeflateFlush
impl UnwindSafe for DeflateFlush
Blanket Implementations
impl<T> Any for DeflateFlush
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for DeflateFlush
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for DeflateFlush
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for DeflateFlush
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for DeflateFlush
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for DeflateFlush
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for DeflateFlush
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for DeflateFlush
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for DeflateFlush
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>