Module winnow::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 IResult alias, rather than Result. finish is provided for top-level parsers to integrate with your application’s error reporting.

Error types include:

Structs

  • Default error type, only contains the error’ location and kind
  • Accumulates error information while backtracking

Enums

  • The Err enum indicates the parser was not successful
  • Indicates which parser returned an error
  • Contains information on needed data if a parser returned Incomplete
  • Error context for VerboseError

Traits

Functions

  • append_errorDeprecated
    Combines an existing error with a new one created from the input position and an ErrorKind. This is useful when backtracking through a parse tree, accumulating error context on the way
  • contextDeprecated
    Create a new error from an input position, a static string and an existing error. This is used mainly in the context combinator, to add user friendly information to errors when backtracking through a parse tree
  • Transforms a VerboseError into a trace with input position information
  • dbg_dmpDeprecated
    Prints a message and the input if the parser fails.
  • make_errorDeprecated
    Creates an error from the input position and an ErrorKind

Type Definitions