Module error

Source
Expand description

§Error management

Errors are designed with multiple needs in mind:

To abstract these needs away from the user, generally winnow parsers use the ModalResult alias, rather than Result. Parser::parse is a top-level operation that can help convert to a Result for integrating with your application’s error reporting.

Error types include:

Structs§

ContextError
Accumulate context while backtracking errors
EmptyError
Track an error occurred without any other StrContext
InputError
Capture input on error
ParseError
See Parser::parse
TreeErrorBasestd
See TreeErrorFrame::Kind, ParserError::append
TreeErrorContextstd
See TreeErrorFrame::Context, AddContext::add_context

Enums§

ErrMode
Add parse error state to ParserErrors
Needed
Contains information on needed data if a parser returned Incomplete
StrContext
Additional parse context for ContextError added via Parser::context
StrContextValue
See StrContext
TreeErrorstd
Trace all error paths, particularly for tests
TreeErrorFramestd
See TreeError::Stack

Traits§

AddContext
Used by Parser::context to add custom data to error while backtracking
ErrorConvert
Equivalent of From implementation to avoid orphan rules in bits parsers
FromExternalError
Create a new error with an external error, from std::str::FromStr
FromRecoverableErrorunstable-recover and std
Capture context from when an error was recovered
ModalError
Manipulate the how parsers respond to this error
ParserError
The basic Parser trait for errors

Type Aliases§

ModalResult
Modal error reporting for Parser::parse_next
Result
By default, the error type (E) is ContextError.