Enum serde_valid::validation::Composited
source · pub enum Composited<Error> {
Single(Error),
Array(IndexMap<usize, Composited<Error>>),
}
Expand description
Composited use Vec or Map error.
Composited elevates field validation errors to per-element error in the array.
§Examples
use serde_valid::Validate;
#[derive(Validate)]
pub struct Data {
#[validate(minimum = 0)]
#[validate(maximum = 10)]
pub val: Vec<i32>, // <-- Here
}
Variants§
Single(Error)
Array(IndexMap<usize, Composited<Error>>)
Trait Implementations§
source§impl<Error: Debug> Debug for Composited<Error>
impl<Error: Debug> Debug for Composited<Error>
source§impl IntoError<EnumerateError> for Composited<EnumerateError>
impl IntoError<EnumerateError> for Composited<EnumerateError>
fn into_error_by(self, format: Format<EnumerateError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<ExclusiveMaximumError> for Composited<ExclusiveMaximumError>
impl IntoError<ExclusiveMaximumError> for Composited<ExclusiveMaximumError>
fn into_error_by(self, format: Format<ExclusiveMaximumError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<ExclusiveMinimumError> for Composited<ExclusiveMinimumError>
impl IntoError<ExclusiveMinimumError> for Composited<ExclusiveMinimumError>
fn into_error_by(self, format: Format<ExclusiveMinimumError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MaxItemsError> for Composited<MaxItemsError>
impl IntoError<MaxItemsError> for Composited<MaxItemsError>
fn into_error_by(self, format: Format<MaxItemsError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MaxLengthError> for Composited<MaxLengthError>
impl IntoError<MaxLengthError> for Composited<MaxLengthError>
fn into_error_by(self, format: Format<MaxLengthError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MaxPropertiesError> for Composited<MaxPropertiesError>
impl IntoError<MaxPropertiesError> for Composited<MaxPropertiesError>
fn into_error_by(self, format: Format<MaxPropertiesError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MaximumError> for Composited<MaximumError>
impl IntoError<MaximumError> for Composited<MaximumError>
fn into_error_by(self, format: Format<MaximumError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MinItemsError> for Composited<MinItemsError>
impl IntoError<MinItemsError> for Composited<MinItemsError>
fn into_error_by(self, format: Format<MinItemsError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MinLengthError> for Composited<MinLengthError>
impl IntoError<MinLengthError> for Composited<MinLengthError>
fn into_error_by(self, format: Format<MinLengthError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MinPropertiesError> for Composited<MinPropertiesError>
impl IntoError<MinPropertiesError> for Composited<MinPropertiesError>
fn into_error_by(self, format: Format<MinPropertiesError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MinimumError> for Composited<MinimumError>
impl IntoError<MinimumError> for Composited<MinimumError>
fn into_error_by(self, format: Format<MinimumError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<MultipleOfError> for Composited<MultipleOfError>
impl IntoError<MultipleOfError> for Composited<MultipleOfError>
fn into_error_by(self, format: Format<MultipleOfError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<PatternError> for Composited<PatternError>
impl IntoError<PatternError> for Composited<PatternError>
fn into_error_by(self, format: Format<PatternError>) -> Error
fn into_error(self) -> Error
source§impl IntoError<UniqueItemsError> for Composited<UniqueItemsError>
impl IntoError<UniqueItemsError> for Composited<UniqueItemsError>
fn into_error_by(self, format: Format<UniqueItemsError>) -> Error
fn into_error(self) -> Error
Auto Trait Implementations§
impl<Error> Freeze for Composited<Error>where
Error: Freeze,
impl<Error> RefUnwindSafe for Composited<Error>where
Error: RefUnwindSafe,
impl<Error> Send for Composited<Error>where
Error: Send,
impl<Error> Sync for Composited<Error>where
Error: Sync,
impl<Error> Unpin for Composited<Error>where
Error: Unpin,
impl<Error> UnwindSafe for Composited<Error>where
Error: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more