Trait winnow::RecoverableParser
source · pub trait RecoverableParser<I, O, R, E> {
// Required method
fn recoverable_parse(&mut self, input: I) -> (I, Option<O>, Vec<R>);
}
Expand description
Collect all errors when parsing the input
Parser
s will need to use Recoverable<I, _>
for their input.
Required Methods§
sourcefn recoverable_parse(&mut self, input: I) -> (I, Option<O>, Vec<R>)
fn recoverable_parse(&mut self, input: I) -> (I, Option<O>, Vec<R>)
Collect all errors when parsing the input
If self
fails, this acts like Parser::resume_after
and returns Ok(None)
.
Generally, this should be avoided by using
Parser::retry_after
and Parser::resume_after
throughout your parser.
The empty input
is returned to allow turning the errors into ParserError
s.
Implementors§
impl<P, I, O, R, E> RecoverableParser<I, O, R, E> for Pwhere
P: Parser<Recoverable<I, R>, O, E>,
I: Stream + StreamIsPartial,
R: FromRecoverableError<Recoverable<I, R>, E> + Debug,
E: FromRecoverableError<Recoverable<I, R>, E> + ParserError<Recoverable<I, R>> + Debug,
Available on crate feature
unstable-recover
only.