vouched_core/lib.rs
1//! Core error types used by `vouched` generated code.
2//!
3//! Most users should depend on the facade crate, `vouched`, which re-exports these types together with the derive macro.
4//! This crate exists so generated code can refer to stable validation error types.
5//!
6//! The important public pieces are:
7//!
8//! - [`TooShortError`] and [`TooLongError`] for `len(...)` failures.
9//! - [`InvalidCharError`] for `chars(...)` failures.
10//! - [`OutOfRangeNumericError`] and [`NumericValue`] for numeric `range(...)` and `cast(try_from(...))` failures.
11//! - [`VouchedError`], implemented by generated error enums.
12//! - [`Error`], an allocation-backed erased wrapper available with `alloc`.
13
14#![cfg_attr(not(feature = "std"), no_std)]
15
16#[cfg(feature = "alloc")]
17extern crate alloc;
18
19mod error;
20
21pub use error::*;