pub type ValidationResult<T> = Result<T, ValidationErrors>;Expand description
Result type for validation operations.
Returns Ok(T) on success, or Err(ValidationErrors) containing
all validation failures.
Aliased Type§
pub enum ValidationResult<T> {
Ok(T),
Err(ValidationErrors),
}Variants§
Trait Implementations§
Source§impl<T> ValidationResultExt<T> for ValidationResult<T>
impl<T> ValidationResultExt<T> for ValidationResult<T>
Source§fn map_valid<U, F: FnOnce(T) -> U>(self, f: F) -> ValidationResult<U>
fn map_valid<U, F: FnOnce(T) -> U>(self, f: F) -> ValidationResult<U>
Map the success value, preserving validation errors
Source§fn and_also<U>(self, other: ValidationResult<U>) -> ValidationResult<(T, U)>
fn and_also<U>(self, other: ValidationResult<U>) -> ValidationResult<(T, U)>
Combine with another validation result, collecting all errors
Source§fn with_errors(self, other: ValidationResult<()>) -> ValidationResult<T>
fn with_errors(self, other: ValidationResult<()>) -> ValidationResult<T>
Add errors from another result without changing the success type