Struct snap::Writer [] [src]

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

A writer for compressing a Snappy stream.

This Writer wraps any other writer that implements io::Write. Bytes written to this writer are compressed using the Snappy frame format (file extension sz, MIME type application/x-snappy-framed).

Writes are buffered automatically, so there's no need to wrap the given writer in a std::io::BufWriter.

The writer will be flushed automatically when it is dropped. If an error occurs, it is ignored.

Methods

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

Create a new writer for streaming Snappy compression.

Returns the underlying stream, consuming and flushing this writer.

If flushing the writer caused an error, then an IntoInnerError is returned, which contains both the writer and the original writer.

Trait Implementations

impl<W: Write> Drop for Writer<W>
[src]

A method called when the value goes out of scope. Read more

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

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more