Struct libflate::finish::AutoFinish [] [src]

pub struct AutoFinish<T: Complete> { /* fields omitted */ }

A wrapper struct that completes the processing of the underlying instance when drops.

This calls Complete:::complete method of T when drops.

Panics

If the invocation of Complete::complete(T) returns an error, AutoFinish::drop() will panic.

Methods

impl<T: Complete> AutoFinish<T>
[src]

[src]

Makes a new AutoFinish instance.

Examples

use std::io;
use libflate::finish::AutoFinish;
use libflate::gzip::Encoder;

let plain = b"Hello World!";
let mut buf = Vec::new();
let mut encoder = AutoFinish::new(Encoder::new(&mut buf).unwrap());
io::copy(&mut &plain[..], &mut encoder).unwrap();

[src]

Unwraps this AutoFinish instance, returning the underlying instance.

Trait Implementations

impl<T: Debug + Complete> Debug for AutoFinish<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Complete> Drop for AutoFinish<T>
[src]

[src]

Executes the destructor for this type. Read more

impl<T: Complete> Deref for AutoFinish<T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<T: Complete> DerefMut for AutoFinish<T>
[src]

[src]

Mutably dereferences the value.

impl<T: Complete + Write> Write for AutoFinish<T>
[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