error_rail/validation/mod.rs
1//! Validation types and utilities for accumulating errors.
2//!
3//! This module provides the [`Validation`] type, which can accumulate multiple
4//! errors while preserving success values. It's particularly useful for validating
5//! complex data structures where you want to collect all validation errors at once
6//! rather than failing on the first error.
7//!
8//! # Key Components
9//!
10//! - [`Validation`] - Core type that represents either a valid value or accumulated errors
11//! - Iterator adapters for traversing errors
12//! - Trait implementations for composing validations
13//!
14//! # Examples
15//!
16//! ```
17//! use error_rail::validation::Validation;
18//!
19//! let valid: Validation<String, i32> = Validation::Valid(42);
20//! assert!(valid.is_valid());
21//!
22//! let invalid: Validation<&str, i32> = Validation::invalid_many(["err1", "err2"]);
23//! assert_eq!(invalid.iter_errors().count(), 2);
24//! ```
25pub mod core;
26pub mod iter;
27pub mod prelude;
28pub mod traits;
29
30pub use self::core::*;
31pub use self::iter::*;
32// Note: traits module provides impl blocks for WithError and ErrorCategory
33// which are automatically available when this module is compiled