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]

[src]

Create a new writer for streaming Snappy compression.

[src]

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.

[src]

Gets a reference to the underlying writer in this encoder.

Trait Implementations

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

[src]

Executes the destructor for this type. Read more

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

[src]

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

[src]

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

1.0.0
[src]

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

1.0.0
[src]

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

1.0.0
[src]

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