Expand description
This module contains reader-based structs and traits.
Because std::io::Read
is only limited to std
and not core
, we provide 2 alternative readers.
Reader is a reader for sources that do not own their data. It is assumed that the reader’s data is dropped after the read
method is called. This reader is incapable of reading borrowed data, like &str
and &[u8]
.
BorrowReader is an extension of Reader
that also allows returning borrowed data. A BorrowReader
allows reading &str
and &[u8]
.
Specifically the Reader
trait is used by Decode and the BorrowReader
trait is used by [BorrowDecode]
.
Structs§
- A reader type for
&[u8]
slices. Implements both Reader and BorrowReader, and thus can be used for borrowed data.
Traits§
- A reader for borrowed data. Implementors of this must also implement the Reader trait. See the module documentation for more information.
- A reader for owned data. See the module documentation for more information.