pub trait Read<'de> {
type Error: Error + 'static;
// Required methods
fn fill<'short>(
&'short mut self,
want: usize,
) -> Result<Reference<'de, 'short>, Self::Error>;
fn advance(&mut self, n: usize);
// Provided methods
fn step_in(&mut self) -> bool { ... }
fn step_out(&mut self) { ... }
}
Expand description
Read trait
This is similar to BufRead
of standard library,
but can define its own error types, and can get a
reference with a long enough lifetime to implement zero-copy decode.