pub struct OwnedReadHalf { /* private fields */ }blocking only.Expand description
Owned output half returned by Session::into_parts.
§End-of-file
read returns Ok(0) when the session is over. Errors that
mean “the other end is gone” — ERROR_BROKEN_PIPE, ERROR_HANDLE_EOF,
ERROR_NO_DATA, ERROR_PIPE_NOT_CONNECTED — are reported as that same
end-of-file, not as errors, so read_to_end finishes cleanly instead of
failing on the last read.
Reaching end-of-file, and dropping this half, are both reported to the
session’s lifecycle machinery: they are the events that let
ClosePseudoConsole run promptly instead of waiting for a reader that will
never come back.
The bytes are a UTF-8 virtual-terminal stream. They arrive in whatever chunks the console host produced, so a multi-byte character can straddle two reads — decode across reads (or buffer) rather than per read.
Trait Implementations§
Source§impl Debug for OwnedReadHalf
Deliberately opaque: what this half owns — a pipe handle and lifecycle
bookkeeping — is exactly what Debug must not turn into public surface.
impl Debug for OwnedReadHalf
Deliberately opaque: what this half owns — a pipe handle and lifecycle
bookkeeping — is exactly what Debug must not turn into public surface.
Source§impl Read for OwnedReadHalf
impl Read for OwnedReadHalf
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf. Read more1.0.0 · Source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.6.0 · Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moreSource§fn read_buf(&mut self, buf: BorrowedCursor<'_, u8>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_, u8>) -> Result<(), Error>
read_buf)Source§fn read_buf_exact(
&mut self,
cursor: BorrowedCursor<'_, u8>,
) -> Result<(), Error>
fn read_buf_exact( &mut self, cursor: BorrowedCursor<'_, u8>, ) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more1.0.0 · Source§fn chain<R>(self, next: R) -> Chain<Self, R>
fn chain<R>(self, next: R) -> Chain<Self, R>
1.0.0 · Source§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit bytes from it. Read moreSource§fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Error>where
Self: Sized,
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], Error>where
Self: Sized,
read_array)