[][src]Struct autocompress::Encoder

pub struct Encoder<W: Write> { /* fields omitted */ }

structure of encoding writer

Methods

impl<W: Write> Encoder<W>[src]

pub fn new(
    writer: W,
    format: Format,
    compression_level: CompressionLevel
) -> Result<Self>
[src]

create new encoder with a writer, a format and a compression level.

let mut encoder = Encoder::new(
    std::fs::File::create("new-file.txt.gz")?,
    Format::Gzip,
    CompressionLevel::Default
)?;
encoder.write_all(b"hello, world")?;

Trait Implementations

impl<W: Write> Write for Encoder<W>[src]

Auto Trait Implementations

impl<W> !RefUnwindSafe for Encoder<W>

impl<W> !Send for Encoder<W>

impl<W> !Sync for Encoder<W>

impl<W> Unpin for Encoder<W> where
    W: Unpin

impl<W> !UnwindSafe for Encoder<W>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.