Struct layered_io::LayeredDuplexer[][src]

pub struct LayeredDuplexer<Inner> { /* fields omitted */ }

Adapts an Read + Write to implement DuplexLayered.

Implementations

impl<Inner: Read + Write> LayeredDuplexer<Inner>[src]

pub fn new(inner: Inner) -> Self[src]

Construct a new LayeredDuplexer which wraps inner with default settings.

pub fn with_eos_as_push(inner: Inner) -> Self[src]

Construct a new LayeredDuplexer which wraps inner. When inner reports end of stream (by returning 0), report a push but keep the stream open and continue to read data on it.

For example, when reading a file, when the reader reaches the end of the file it will report it, but consumers may wish to continue reading in case additional data is appended to the file.

pub fn line_by_line(inner: Inner) -> Self[src]

Construct a new LayeredDuplexer which wraps an inner which reads its input line-by-line, such as stdin on a terminal.

pub fn close_into_inner(self) -> Result<Inner>[src]

Close this LayeredDuplexer and return the inner stream.

pub fn abandon_into_inner(self) -> Option<Inner>[src]

Consume this LayeredDuplexer and return the inner stream.

Trait Implementations

impl<Inner: Duplex + AsRawReadWriteFd> AsRawReadWriteFd for LayeredDuplexer<Inner>[src]

impl<Inner> Bufferable for LayeredDuplexer<Inner>[src]

impl<Inner: Debug> Debug for LayeredDuplexer<Inner>[src]

impl<Inner: Read + Write + Duplex> Duplex for LayeredDuplexer<Inner>[src]

impl<Inner: Duplex + OwnsRaw> OwnsRaw for LayeredDuplexer<Inner>[src]

impl<Inner: Read + Write> Read for LayeredDuplexer<Inner>[src]

impl<Inner: Read + Write> ReadLayered for LayeredDuplexer<Inner>[src]

impl<Inner: Read + Write> Write for LayeredDuplexer<Inner>[src]

impl<Inner: Read + Write> WriteLayered for LayeredDuplexer<Inner>[src]

Auto Trait Implementations

impl<Inner> RefUnwindSafe for LayeredDuplexer<Inner> where
    Inner: RefUnwindSafe

impl<Inner> Send for LayeredDuplexer<Inner> where
    Inner: Send

impl<Inner> Sync for LayeredDuplexer<Inner> where
    Inner: Sync

impl<Inner> Unpin for LayeredDuplexer<Inner> where
    Inner: Unpin

impl<Inner> UnwindSafe for LayeredDuplexer<Inner> where
    Inner: UnwindSafe

Blanket Implementations

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

impl<T> AsUnsafeReadWriteHandle for T where
    T: OwnsRaw + AsRawReadWriteFd
[src]

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

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

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

impl<T> HalfDuplex for T where
    T: Duplex + Read + Write
[src]

impl<T, U> Into<U> for T where
    U: From<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.