Struct AutoFlushDecoder

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

A wrapper around a Decoder<W> that flushes the stream on drop.

This can be created by the auto_flush() method on the Decoder.

Implementations

impl<'a, W: Write, F: FnMut(io::Result<()>)> AutoFlushDecoder<'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 decoder is continued to be used.

Mostly used for testing purposes.

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

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

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

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

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

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

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

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

fn type_id(self: &Self) -> TypeId

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

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

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for AutoFlushDecoder<'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 AutoFlushDecoder<'a, W, F>

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

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

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

impl<W, F> Drop for AutoFlushDecoder<'_, W, F>

fn drop(self: &mut Self)

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

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