Expand description
Core error types used by vouched generated code.
Most users should depend on the facade crate, vouched, which re-exports these types together with the derive macro.
This crate exists so generated code can refer to stable validation error types.
The important public pieces are:
TooShortErrorandTooLongErrorforlen(...)failures.InvalidCharErrorforchars(...)failures.OutOfRangeNumericErrorandNumericValuefor numericrange(...)andcast(try_from(...))failures.VouchedError, implemented by generated error enums.Error, an allocation-backed erased wrapper available withalloc.
Structs§
- Error
- Wrapper type for handling different Vouched error types uniformly.
- Invalid
Char Error - Error returned when a string newtype contains a character rejected by
chars. - Numeric
Value - Lossless numeric value captured by generated range and cast errors.
- OutOf
Range Numeric Error - Error returned when a numeric newtype is outside its
rangebounds. - TooLong
Error - Error returned when a string newtype is longer than its
lenupper bound. - TooShort
Error - Error returned when a string newtype is shorter than its
lenlower bound.
Traits§
- Vouched
Error - Common interface for generated Vouched errors.