Struct layered_io::LayeredDuplexer [−][src]
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]
fn as_raw_read_fd(&self) -> RawFd
[src]
fn as_raw_write_fd(&self) -> RawFd
[src]
impl<Inner> Bufferable for LayeredDuplexer<Inner>
[src]
fn abandon(&mut self)
[src]
fn suggested_buffer_size(&self) -> usize
[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]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
[src]
fn is_read_vectored(&self) -> bool
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
[src]
pub unsafe fn initializer(&self) -> Initializer
[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
pub fn bytes(self) -> Bytes<Self>
1.0.0[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<Inner: Read + Write> ReadLayered for LayeredDuplexer<Inner>
[src]
fn read_with_status(&mut self, buf: &mut [u8]) -> Result<(usize, Status)>
[src]
fn read_vectored_with_status(
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<(usize, Status)>
[src]
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<(usize, Status)>
fn read_exact_using_status(&mut self, buf: &mut [u8]) -> Result<Status>
[src]
fn minimum_buffer_size(&self) -> usize
[src]
impl<Inner: Read + Write> Write for LayeredDuplexer<Inner>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<()>
[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
[src]
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
impl<Inner: Read + Write> WriteLayered for LayeredDuplexer<Inner>
[src]
Auto Trait Implementations
impl<Inner> RefUnwindSafe for LayeredDuplexer<Inner> where
Inner: RefUnwindSafe,
Inner: RefUnwindSafe,
impl<Inner> Send for LayeredDuplexer<Inner> where
Inner: Send,
Inner: Send,
impl<Inner> Sync for LayeredDuplexer<Inner> where
Inner: Sync,
Inner: Sync,
impl<Inner> Unpin for LayeredDuplexer<Inner> where
Inner: Unpin,
Inner: Unpin,
impl<Inner> UnwindSafe for LayeredDuplexer<Inner> where
Inner: UnwindSafe,
Inner: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsUnsafeReadWriteHandle for T where
T: OwnsRaw + AsRawReadWriteFd,
[src]
T: OwnsRaw + AsRawReadWriteFd,
pub fn as_unsafe_read_handle(&self) -> UnsafeHandle
[src]
pub fn as_unsafe_write_handle(&self) -> UnsafeHandle
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> HalfDuplex for T where
T: Duplex + Read + Write,
[src]
T: Duplex + Read + Write,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,