[][src]Struct pgp::line_writer::LineWriter

pub struct LineWriter<'a, W, N> where
    W: Write,
    N: Unsigned + ArrayLength<u8>,
    N: Add<U2>,
    Sum<N, U2>: ArrayLength<u8>, 
{ /* fields omitted */ }

A Write implementation that splits any written bytes into the given length lines.

Panics

Calling write() after finish() is invalid and will panic.

Methods

impl<'a, W, N> LineWriter<'a, W, N> where
    W: 'a + Write,
    N: Unsigned + ArrayLength<u8>,
    N: Add<U2>,
    Sum<N, U2>: ArrayLength<u8>, 
[src]

pub fn new(w: &'a mut W, line_break: LineBreak) -> Self[src]

Create a new encoder around an existing writer.

pub fn finish(&mut self) -> Result<()>[src]

Write all remaining buffered data.

Once this succeeds, no further writes can be performed.

Errors

Assuming the wrapped writer obeys the Write contract, if this returns Err, no data was written, and finish() may be retried if appropriate for the type of error, etc.

Trait Implementations

impl<'a, W, N> Drop for LineWriter<'a, W, N> where
    W: 'a + Write,
    N: Unsigned + ArrayLength<u8>,
    N: Add<U2>,
    Sum<N, U2>: ArrayLength<u8>, 
[src]

impl<'a, W, N> Write for LineWriter<'a, W, N> where
    W: 'a + Write,
    N: Unsigned + ArrayLength<u8>,
    N: Add<U2>,
    Sum<N, U2>: ArrayLength<u8>, 
[src]

fn flush(&mut self) -> Result<()>[src]

Because this is usually treated as OK to call multiple times, it will not flush any incomplete chunks of input or write padding.

Auto Trait Implementations

impl<'a, W, N> Send for LineWriter<'a, W, N> where
    W: Send

impl<'a, W, N> Sync for LineWriter<'a, W, N> where
    W: Sync

impl<'a, W, N> Unpin for LineWriter<'a, W, N> where
    <N as ArrayLength<u8>>::ArrayType: Unpin,
    <<N as Add<UInt<UInt<UTerm, B1>, B0>>>::Output as ArrayLength<u8>>::ArrayType: Unpin

impl<'a, W, N> !UnwindSafe for LineWriter<'a, W, N>

impl<'a, W, N> RefUnwindSafe for LineWriter<'a, W, N> where
    W: RefUnwindSafe,
    <N as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
    <<N as Add<UInt<UInt<UTerm, B1>, B0>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]

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

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