Module range

Source
Expand description

Module containing zero-copy parsers.

These parsers require the RangeStream bound instead of a plain Stream.

Structs§

Range
Recognize
RecognizeWithValue
Take
TakeFn
TakeUntilRange
TakeWhile
TakeWhile1

Enums§

TakeRange

Functions§

length_prefix
Takes a parser which parses a length then extracts a range of that length and returns it. Commonly used in binary formats
range
Zero-copy parser which reads a range of length i.len() and succeeds if i is equal to that range.
recognize
Zero-copy parser which returns committed input range.
recognize_with_value
Zero-copy parser which returns a pair: (committed input range, parsed value).
take
Zero-copy parser which reads a range of length n.
take_fn
Searches the entire range using searcher and then consumes a range of Some(n). If f can not find anything in the range it must return None/NotFound which indicates an end of input error.
take_until_range
Zero-copy parser which reads a range of 0 or more tokens until r is found.
take_while
Zero-copy parser which reads a range of 0 or more tokens which satisfy f.
take_while1
Zero-copy parser which reads a range of 1 or more tokens which satisfy f.