2 releases

0.1.1 Sep 27, 2024
0.1.0 Jun 26, 2024

#1134 in Algorithms

Download history 38/week @ 2024-08-17 43/week @ 2024-08-24 81/week @ 2024-08-31 28/week @ 2024-09-07 56/week @ 2024-09-14 166/week @ 2024-09-21 141/week @ 2024-09-28 32/week @ 2024-10-05 28/week @ 2024-10-12 32/week @ 2024-10-19 42/week @ 2024-10-26 31/week @ 2024-11-02 6/week @ 2024-11-09 29/week @ 2024-11-16 45/week @ 2024-11-23 47/week @ 2024-11-30

128 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