2 releases

0.1.1 Sep 27, 2024
0.1.0 Jun 26, 2024

#949 in Algorithms

Download history 141/week @ 2024-06-24 6/week @ 2024-07-01 7/week @ 2024-07-08 37/week @ 2024-07-15 8/week @ 2024-07-22 36/week @ 2024-08-12 38/week @ 2024-08-19 83/week @ 2024-08-26 32/week @ 2024-09-02 36/week @ 2024-09-09 60/week @ 2024-09-16 223/week @ 2024-09-23 88/week @ 2024-09-30 16/week @ 2024-10-07

387 downloads per month
Used in 22 crates (via swimos_utilities)

Apache-2.0

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.

Dependencies