Enum axum_valid::ValidRejection
source · pub enum ValidRejection<E> {
Valid(ValidationErrors),
Inner(E),
}Expand description
ValidRejection is returned when the Valid extractor fails.
This enumeration captures two types of errors that can occur when using Valid: errors related to the validation
logic itself (encapsulated in Valid), and errors that may arise within the inner extractor (represented by Inner).
Variants§
Valid(ValidationErrors)
Valid variant captures errors related to the validation logic. It contains ValidationErrors
which is a collection of validation failures for each field.
Inner(E)
Inner variant represents potential errors that might occur within the inner extractor.
Trait Implementations§
source§impl<E: Debug> Debug for ValidRejection<E>
impl<E: Debug> Debug for ValidRejection<E>
source§impl<E: Display> Display for ValidRejection<E>
impl<E: Display> Display for ValidRejection<E>
source§impl<E: Error + 'static> Error for ValidRejection<E>
impl<E: Error + 'static> Error for ValidRejection<E>
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<E> From<ValidationErrors> for ValidRejection<E>
impl<E> From<ValidationErrors> for ValidRejection<E>
source§fn from(value: ValidationErrors) -> Self
fn from(value: ValidationErrors) -> Self
Converts to this type from the input type.
source§impl<E: IntoResponse> IntoResponse for ValidRejection<E>
impl<E: IntoResponse> IntoResponse for ValidRejection<E>
source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl<E> RefUnwindSafe for ValidRejection<E>where
E: RefUnwindSafe,
impl<E> Send for ValidRejection<E>where
E: Send,
impl<E> Sync for ValidRejection<E>where
E: Sync,
impl<E> Unpin for ValidRejection<E>where
E: Unpin,
impl<E> UnwindSafe for ValidRejection<E>where
E: 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