pub trait BufReadFromBytesExt: BufRead {
// Provided method
fn skip_until_match(&mut self, pattern: &[u8]) -> Result<bool, Error> { ... }
}
Expand description
Extension to std::io::BufRead
providing convenience methods for operations
commonly used when reading binary formats.
Provided Methods§
Sourcefn skip_until_match(&mut self, pattern: &[u8]) -> Result<bool, Error>
fn skip_until_match(&mut self, pattern: &[u8]) -> Result<bool, Error>
Consume bytes from this reader until pattern
has been consumed.
If pattern
is found, true is returned and the reader has been
advanced to the byte immediately following the last byte of pattern
.
Otherwise, returns false and the reader is at EOF.
§Errors
This function will ignore all instances of ErrorKind::Interrupted
and
will otherwise return any errors returned by BufRead::fill_buf
.