Struct AutoFinishEncoder

struct AutoFinishEncoder<'a, W: Write, F: FnMut(io::Result<W>) = Box<dyn Send + FnMut(io::Result<W>)>> { ... }

A wrapper around an Encoder<W> that finishes the stream on drop.

This can be created by the auto_finish() method on the Encoder.

Implementations

impl<'a, W: Write, F: FnMut(io::Result<W>)> AutoFinishEncoder<'a, W, F>

fn get_ref(self: &Self) -> &W

Acquires a reference to the underlying writer.

fn get_mut(self: &mut Self) -> &mut W

Acquires a mutable reference to the underlying writer.

Note that mutation of the writer may result in surprising results if this encoder is continued to be used.

Mostly used for testing purposes.

impl<'a, W, F = Box<dyn FnMut(Result<W, Error>) + Send>> UnwindSafe for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> Freeze for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> RefUnwindSafe for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> Send for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> Sync for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> Unpin for AutoFinishEncoder<'a, W, F>

impl<'a, W, F> UnsafeUnpin for AutoFinishEncoder<'a, W, F>

impl<T> Any for AutoFinishEncoder<'a, W, F>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for AutoFinishEncoder<'a, W, F>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for AutoFinishEncoder<'a, W, F>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for AutoFinishEncoder<'a, W, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for AutoFinishEncoder<'a, W, F>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for AutoFinishEncoder<'a, W, F>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for AutoFinishEncoder<'a, W, F>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<W: Write, F: FnMut(io::Result<W>)> Drop for AutoFinishEncoder<'_, W, F>

fn drop(self: &mut Self)

impl<W: Write, F: FnMut(io::Result<W>)> Write for AutoFinishEncoder<'_, W, F>

fn write(self: &mut Self, buf: &[u8]) -> Result<usize>
fn flush(self: &mut Self) -> Result<()>