Crate layered_io
source ·Expand description
I/O traits extending std::io::Read
and std::io::Write
.
Structs§
- Adapts an
Read
to implementReadLayered
. - Adapts a
std::io::Write
to implementWriteLayered
. - Adapts an
&[u8]
to implementReadLayered
.
Enums§
- For interactivity, it’s desirable to avoid buffering data which is complete enough to be actionable.
Activity
allows writers to notify the API at points when the data provided is actionable and buffers should be flushed to the reader. - What is known about a stream in the future.
Traits§
- A trait to help with buffering on top of
ReadLayered
andWriteLayered
. - An extension of
Read
, withread_with_status
andread_vectored_with_status
which return status information and zero is not special-cased. It also allows streams to specify aminimum_buffer_size
. - An extension of
std::io::Write
, but adds aclose
function to allow the stream to be closed and any outstanding errors to be reported, without requiring async_all
.
Functions§
- Default implementation of
Read::is_read_vectored
accompanying [default_read_vectored_with_status
]. - Default implementation of
Write::is_write_vectored
accompanyingdefault_write_vectored
. - Default implementation of
Read::read
in terms ofReadLayered::read_with_status
. - Default implementation of
ReadLayered::read_exact_using_status
in terms ofReadLayered::read_with_status
. - Default implementation of
Read::read_to_end
in terms ofReadLayered::read_with_status
. - Default implementation of
Read::read_to_string
in terms ofRead::read_to_end
. - Default implementation of
Read::read_vectored
in terms ofReadLayered::read_vectored_with_status
. - Default implementation of
Bufferable::abandon
, which does nothing. - Default implementation of
Write::write_all
, in terms ofWrite::write
. - Default implementation of
Write::write_all_vectored
, in terms ofWrite::write_vectored
. - Default implementation of
Write::write_vectored
, in terms ofWrite::write
. - Translate from
read_with_status
’s return value with independent size and status to astd::io::Read::read
return value where 0 is special-cased to mean end-of-stream, anio::ErrorKind::Interrupted
error is used to indicate a zero-length read, and pushes are not reported.