[][src]Struct async_compression::stream::DeflateEncoder

pub struct DeflateEncoder<S: Stream<Item = Result<Bytes>>> { /* fields omitted */ }
This is supported on feature="stream" and feature="deflate" only.

A deflate encoder, or compressor.

This structure implements a Stream interface and will read uncompressed data from an underlying stream and emit a stream of compressed data.

Methods

impl<S: Stream<Item = Result<Bytes>>> DeflateEncoder<S>[src]

pub fn new(inner: S, level: Compression) -> Self[src]

This is supported on feature="stream" only.

Creates a new encoder which will read uncompressed data from the given stream and emit a compressed stream.

pub fn get_ref(&self) -> &S[src]

This is supported on feature="stream" only.

Acquires a reference to the underlying stream that this encoder is wrapping.

pub fn get_mut(&mut self) -> &mut S[src]

This is supported on feature="stream" only.

Acquires a mutable reference to the underlying stream that this encoder is wrapping.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this encoder.

pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut S>[src]

This is supported on feature="stream" only.

Acquires a pinned mutable reference to the underlying stream that this encoder is wrapping.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this encoder.

pub fn into_inner(self) -> S[src]

This is supported on feature="stream" only.

Consumes this encoder returning the underlying stream.

Note that this may discard internal state of this encoder, so care should be taken to avoid losing resources when this is called.

Trait Implementations

impl<'pin, S: Stream<Item = Result<Bytes>>> Unpin for DeflateEncoder<S> where
    __DeflateEncoder<'pin, S>: Unpin
[src]

impl<S: Debug + Stream<Item = Result<Bytes>>> Debug for DeflateEncoder<S>

impl<S: Stream<Item = Result<Bytes>>> Stream for DeflateEncoder<S>[src]

type Item = Result<Bytes>

Values yielded by the stream.

Auto Trait Implementations

impl<S> Send for DeflateEncoder<S> where
    S: Send

impl<S> Sync for DeflateEncoder<S> where
    S: Sync

impl<S> UnwindSafe for DeflateEncoder<S> where
    S: UnwindSafe

impl<S> RefUnwindSafe for DeflateEncoder<S> where
    S: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future