Skip to main content

MappingParser

Trait MappingParser 

Source
pub trait MappingParser<In, Out, NewOut, Reason = Infallible>: Sized + FnMut(In, Out) -> ParsingResult<In, NewOut, Reason> { }
Expand description

A trait alias for a function that maps from the input & intermediate output to the rest of the input & a different output.

Used in Parser::map.

See [match_out] for a convenient way to create such a mapper.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<In, Out, NewOut, Reason, F> MappingParser<In, Out, NewOut, Reason> for F
where F: Sized + FnMut(In, Out) -> ParsingResult<In, NewOut, Reason>,