validation passed to the canvas library now compiled
This commit is contained in:
26
canvas/src/validation/mod.rs
Normal file
26
canvas/src/validation/mod.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
//! Validation module for canvas form fields
|
||||
|
||||
pub mod config;
|
||||
pub mod limits;
|
||||
pub mod state;
|
||||
|
||||
// Re-export main types
|
||||
pub use config::{ValidationConfig, ValidationResult, ValidationConfigBuilder};
|
||||
pub use limits::{CharacterLimits, LimitCheckResult};
|
||||
pub use state::{ValidationState, ValidationSummary};
|
||||
|
||||
/// Validation error types
|
||||
#[derive(Debug, Clone, thiserror::Error)]
|
||||
pub enum ValidationError {
|
||||
#[error("Character limit exceeded: {current}/{max}")]
|
||||
CharacterLimitExceeded { current: usize, max: usize },
|
||||
|
||||
#[error("Invalid character '{char}' at position {position}")]
|
||||
InvalidCharacter { char: char, position: usize },
|
||||
|
||||
#[error("Validation configuration error: {message}")]
|
||||
ConfigurationError { message: String },
|
||||
}
|
||||
|
||||
/// Result type for validation operations
|
||||
pub type Result<T> = std::result::Result<T, ValidationError>;
|
||||
Reference in New Issue
Block a user