Skip to main content

Parser

Type Alias Parser 

Source
pub type Parser<'i> = Box<dyn Fn(State<'i>) -> Reply<'i> + 'i>;
Expand description

A parser is a function from State to Reply.

Using Box<dyn Fn> keeps the API simple and avoids pervasive generic parameters on every combinator. The hot-path cost is a single indirection per combinator call; this is acceptable for the scaffold phase and can be revisited after profiling.

Aliased Typeยง

pub struct Parser<'i>(/* private fields */);