[][src]Module kul::common::stream

A Parser for parsing inputs that are chunks from streaming sources.

Re-exports

pub use crate::parser::DefaultCharClassifier as CharClassifier;

Functions

parse_stream

Parse the given stream, which is an Iterator of String chunks, using a Parser with no bindings of operators, and return a vector of the results as Datum ASTs for each successfully-parsed top-level form and/or an Error.

parse_stream_with

Parse the given stream, which is an Iterator of String chunks, using a Parser that uses the given OperatorBindings value, and return a vector of the results as Datum ASTs for each successfully-parsed top-level form and/or an Error.

parser

Make a new Parser that uses the given OperatorBindings value and that uses the types chosen by this module.

Type Definitions

DatumAllocator

Chosen so that the Datums in the AST values returned from parsing are simply allocated in heap Boxes without limit.

OperatorBindings

Chosen so that you may establish bindings simply using the std HashMap and with flexible trait objects for the function types.

Parser

A Parser for parsing inputs that are chunks from a streaming source, as a sequence of String chunks yielded by an Iterator, that uses: the default characters as delimiters, Boxes to allocate the Datums in ASTs returned from parsing, and HashMaps to bind operator sub-forms to Combiner macro functions.

Text

Chosen so that the application can choose whether or not to use all the capacity of an input stream's String chunks, and so that referenced parts of chunks are zero-copy, and so that char positions are tracked (relative to the input stream), and so that, when chunks are broken around escape characters, a simple Vec is used to logically concatenate them.

TopFormResult

The Result of parsing a top-level form, and the type of elements returned by parse_stream and parse_stream_with.