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//! - [`OutOfRangeIntegerError`] and [`IntegerValue`] for integer `range(...)` and `impls(try_from(...))` failures.
11//! - [`OutOfRangeFloatError`] and [`FloatValue`] for float `range(...)` failures.
12//! - [`VouchedError`], implemented by generated error enums.
13//! - [`Error`], an allocation-backed erased wrapper available with `alloc`.
14
15#![cfg_attr(not(feature = "std"), no_std)]
16
17#[cfg(feature = "alloc")]
18extern crate alloc;
19
20mod error;
21mod str_inner;
22
23pub use error::*;
24#[doc(hidden)]
25pub use str_inner::VouchedStrInner;