2 releases
0.1.1 | Sep 27, 2024 |
---|---|
0.1.0 | Jun 26, 2024 |
#1018 in Algorithms
116 downloads per month
Used in 22 crates
(via swimos_utilities)
32KB
583 lines
Error Accumulation Framework
This crate provides Validation
, an alternative to the standard library Result
type.
A function that returns a Result
may succeed or fail with a single error. In contrast,
Validation
is used for processes that can produce an numbers of errors that do no
necessarily cause processing to terminate. A function that returns a Validation
may
succeed (returning a value and no error), return a value and an error (indicating that
processing may continue despite the error) or return an unconditional error (indicating that
processing cannot continue).
Validations are composed as the process continues, therefore the error type must be composable
that errors can be accumulated. Typically, the error type of a Validation
will be a
collection of error values and the composition operation will take the union of the two collections.