pub trait Skip: Read {
// Provided method
fn skip(&mut self, len: usize) -> Result<(), Error> { ... }
}Expand description
A trait that allows for efficient skipping forward while reading data.
Provided Methods§
Sourcefn skip(&mut self, len: usize) -> Result<(), Error>
fn skip(&mut self, len: usize) -> Result<(), Error>
Advance the cursor by len bytes.
If possible, the implementation should be more efficient than calling
Read::read and discarding the resulting bytes.
Calling skip with a len that advances the cursor past the end of the
underlying data source is permissible. The only requirement is that the
next call to Read::read indicates EOF.
§Errors
Can return an error in all the same cases that Read::read can.
TODO: Remove this clippy suppression when the issue is fixed. See https://github.com/rust-lang/rust-clippy/issues/12519