Expand description
ErrorAccumulator
is a utility to write parsing functions that work
through as much data as possible collecting errors on the way instead of
doing early returns on the first error.
§General approach
The idea is that an input is walked through all its fields, structs, and
arrays. Along the way ErrorAccumulator
is used to keep track of the
input’s parsing results so in case all parsing was successful the validated
data can be returned and in case of at least one error all
AccumulatedError
s and their source can be named.
Modules§
- builder
- Builder to parse input and accumulate errors.
- construct
- Helper traits to enable some of this crate’s type magic.
- error
- Provide
AccumulatedError
to present a collection of errors. - path
SourcePath
to identify the path to the source of an accumulated error.
Structs§
- Error
Accumulator - The entry-point to accumulate parsing results.
- Error
Accumulator Finisher - Intermediate state when
ErrorAccumulator::on_ok()
was called.