[][src]Struct genio::util::WriteTrunc

pub struct WriteTrunc<W> { /* fields omitted */ }

Truncates writing so that at most n bytes in total are written into the writer.

Excess bytes are silently dropped.

Methods

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

pub fn new(writer: W, max_bytes: u64) -> Self[src]

Initializes truncate.

pub fn remaining_bytes(&self) -> u64[src]

Returns how many bytes remain until they will be truncated.

Trait Implementations

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

type WriteError = W::WriteError

Value of this type is returned when write() fails. Read more

type FlushError = W::FlushError

Value of this type is returned when flush() fails. In case of low-level writers flush often does nothing and therefore doesn't return error, so this type might be Void. Read more

Auto Trait Implementations

impl<W> Send for WriteTrunc<W> where
    W: Send

impl<W> Sync for WriteTrunc<W> where
    W: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]