pub struct OwnedReadHalf { /* private fields */ }tokio only.Expand description
Owned output half returned by Session::into_parts.
§End-of-file
A read completes with zero bytes 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 AsyncReadExt::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 reporting happens in Drop and never blocks: a
close runs inline only where it is proven prompt, and one that cannot be
proven prompt — possible on a backend without ReleasePseudoConsole,
because dropping an async pipe closes the OS handle only once the I/O
driver retires its in-flight read — is handed to a detached thread
instead.
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.