[][src]Module oak_runtime::stream

Collection of traits for retrieving and manipulating a stream. They are used by implementation of parsing expressions.

A stream produces a sequence of items (characters, bytes, etc.) while retaining information on the underlying data traversed. For example, a couple (File, Iterator<char>) could represent a stream of characters from a file.

Traits

CodeSnippet

Produces a code snippet of size len_hint or less starting from the current position in the stream.

ConsumePrefix

Consumes prefix if it fully matches from the current position in the stream. If it does not match, the stream is not altered and false is returned.

HasNext

Returns true if an item can be read from the stream with Iterator::next.

Location

Produces a textual representation of the current position in the stream. For example, it can be 2:5 if the position is at line 2 and column 5.

Stream

Transforms a value into a stream of type Output.

StreamSpan