1 unstable release

0.1.0 Jun 26, 2024

#1464 in Algorithms

Download history 101/week @ 2024-06-20 43/week @ 2024-06-27 5/week @ 2024-07-04 24/week @ 2024-07-11 18/week @ 2024-07-18 8/week @ 2024-07-25 14/week @ 2024-08-08 37/week @ 2024-08-15 41/week @ 2024-08-22 74/week @ 2024-08-29

166 downloads per month
Used in 20 crates (via swimos_utilities)

Apache-2.0

31KB
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.

Dependencies