pub unsafe trait ParseBuf<'p> {
// Required methods
fn chunk(&mut self) -> ParseResult<ParseBufChunk<'_, 'p>>;
fn advance(&mut self, count: usize);
// Provided method
fn remaining_hint(&self) -> Option<usize> { ... }
}Expand description
Required Methods§
Sourcefn chunk(&mut self) -> ParseResult<ParseBufChunk<'_, 'p>>
fn chunk(&mut self) -> ParseResult<ParseBufChunk<'_, 'p>>
Returns a chunk starting at the current position.
This method must never return an empty chunk. If an empty chunk would be
returned, it should return an error instead. ParseError::eof has
been provided for this, though it is not required to use it.
This method must keep returning the same data until advance has been
called to move past it.
See the documentation for ParseBufChunk for an explanation on when
to use ParseBufChunk::Temporary vs ParseBufChunk::External.
Provided Methods§
Sourcefn remaining_hint(&self) -> Option<usize>
fn remaining_hint(&self) -> Option<usize>
An indicator of how many bytes are left, if supported.
This is used for some optimizations within Parser, if Some is
returned then the value must be accurate.