Trait mz_avro::decode::Skip

source ·
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§

source

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

Implementations on Foreign Types§

source§

impl Skip for &[u8]

source§

fn skip(&mut self, len: usize) -> Result<(), Error>

source§

impl Skip for File

source§

fn skip(&mut self, len: usize) -> Result<(), Error>

source§

impl<R: Read> Skip for MultiGzDecoder<R>

source§

impl<S: Skip + ?Sized> Skip for Box<S>

source§

fn skip(&mut self, len: usize) -> Result<(), Error>

source§

impl<T: AsRef<[u8]>> Skip for Cursor<T>

source§

fn skip(&mut self, len: usize) -> Result<(), Error>

Implementors§