2 releases

0.1.1 Sep 27, 2024
0.1.0 Jun 26, 2024

#1018 in Algorithms

Download history 7/week @ 2024-07-28 25/week @ 2024-08-11 38/week @ 2024-08-18 61/week @ 2024-08-25 64/week @ 2024-09-01 37/week @ 2024-09-08 58/week @ 2024-09-15 187/week @ 2024-09-22 123/week @ 2024-09-29 18/week @ 2024-10-06 28/week @ 2024-10-13 32/week @ 2024-10-20 42/week @ 2024-10-27 33/week @ 2024-11-03 8/week @ 2024-11-10

116 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