Skip to main content

ConfigIterParser

Trait ConfigIterParser 

Source
pub trait ConfigIterParser<'src, I, O, E = Default>: IterParser<'src, I, O, E>
where I: Input<'src>, E: ParserExtra<'src, I>,
{ type Config: Default; // Provided methods fn configure<F>(self, cfg: F) -> IterConfigure<Self, F, O> where Self: Sized, F: Fn(Self::Config, &E::Context) -> Self::Config { ... } fn try_configure<F>(self, cfg: F) -> TryIterConfigure<Self, F, O> where Self: Sized, F: Fn(Self::Config, &E::Context, I::Span) -> Result<Self::Config, E::Error> { ... } }
Expand description

An iterable equivalent of ConfigParser, i.e: a parser that generates a sequence of outputs and can be configured at runtime.

Required Associated Types§

Source

type Config: Default

A trait describing the configurable aspects of the iterable parser.

Provided Methods§

Source

fn configure<F>(self, cfg: F) -> IterConfigure<Self, F, O>
where Self: Sized, F: Fn(Self::Config, &E::Context) -> Self::Config,

A combinator that allows configuration of the parser from the current context

Source

fn try_configure<F>(self, cfg: F) -> TryIterConfigure<Self, F, O>
where Self: Sized, F: Fn(Self::Config, &E::Context, I::Span) -> Result<Self::Config, E::Error>,

A combinator that allows fallible configuration of the parser from the current context - if an error is returned, parsing fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'src, A, O, I, E> ConfigIterParser<'src, I, O, E> for Repeated<A, O, I, E>
where I: Input<'src>, E: ParserExtra<'src, I>, A: Parser<'src, I, O, E>,