Gzip

Struct Gzip 

Source
pub struct Gzip {}
Expand description

Gzip deflate stream with gzip header and footer.

Trait Implementations§

Source§

impl Clone for Gzip

Source§

fn clone(&self) -> Gzip

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Gzip

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FormatSpec for Gzip

Source§

type C = Crc32

The Check type for this format.
Source§

type Compressor = Compress

Source§

fn new() -> Self

Create a new instance of this format spec
Source§

fn create_compressor( &self, compression_level: Compression, ) -> Result<Self::Compressor, GzpError>

Create a thread local compressor
Source§

fn needs_dict(&self) -> bool

Whether or not this format should try to use a dictionary.
Source§

fn encode( &self, input: &[u8], encoder: &mut Self::Compressor, compression_level: Compression, dict: Option<&Bytes>, is_last: bool, ) -> Result<Vec<u8>, GzpError>

How to deflate bytes for this format. Returns deflated bytes.
Source§

fn header(&self, compression_level: Compression) -> Vec<u8>

Generate a generic header for the given format.
Source§

fn footer(&self, check: &Self::C) -> Vec<u8>

Generate a genric footer for the format.
Source§

const DEFAULT_BUFSIZE: usize = 131_072usize

The default buffersize to use for this format
Source§

fn create_check() -> Self::C

Create a check value for this format that implements Check
Source§

fn to_bytes(&self, pairs: &[Pair]) -> Vec<u8>

Convert a list of Pair into bytes.
Source§

impl<W> SyncWriter<W> for Gzip
where W: Write,

Source§

type OutputWriter = GzEncoder<W>

Source§

fn sync_writer(writer: W, compression_level: Compression) -> GzEncoder<W>

Source§

impl Copy for Gzip

Auto Trait Implementations§

§

impl Freeze for Gzip

§

impl RefUnwindSafe for Gzip

§

impl Send for Gzip

§

impl Sync for Gzip

§

impl Unpin for Gzip

§

impl UnwindSafe for Gzip

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.