Expand description
Traits and implementations of arbitrary data streams.
Streams are similar to the Iterator trait in that they represent some sequential set of items
which can be retrieved one by one. Where Streams differ is that they are allowed to return
errors instead of just None and if they implement the RangeStreamOnce trait they are also
capable of returning multiple items at the same time, usually in the form of a slice.
In addition to he functionality above, a proper Stream usable by a Parser must also have a
position (marked by the Positioned trait) and must also be resetable (marked by the
Resetable trait). The former is used to ensure that errors at different points in the stream
aren’t combined and the latter is used in parsers such as or to try multiple alternative
parses.
Modules
- Stream wrapper which provides an informative and easy to use error type.
- Stateful stream wrappers.
Structs
- Wrapper around iterators which allows them to be treated as a stream. Returned by
from_iter. - Stream type which indicates that the stream is partial if end of input is reached
- Newtype around a pointer offset into a slice stream (
&[T]/&str). - Newtype for constructing a stream from a slice where the items in the slice are not copyable.
Traits
- A
RangeStreamwhich is capable of providing it’s entire range. - A type which has a position.
- Trait representing a range of elements.
- A
RangeStreamis an extension ofStreamwhich allows for zero copy parsing. - A
RangeStreamis an extension ofStreamOncewhich allows for zero copy parsing. - A stream of tokens which can be duplicated
StreamOncerepresents a sequence of items that can be extracted one by one.
Functions
- Decodes
inputusingparser. - Removes items from the input while
predicatereturnstrue. - Takes items from stream, testing each one with
predicatereturns a range of at least one items which passedpredicate.
Type Aliases
- Convenience alias over the
StreamErrorfor the input streamI