#[non_exhaustive]pub enum RequestValidationError {
EmptyField {
field: &'static str,
},
TooLong {
field: &'static str,
max: usize,
},
LengthOutOfRange {
field: &'static str,
min: usize,
max: usize,
},
InvalidFormat {
field: &'static str,
expected: &'static str,
},
OutOfRange {
field: &'static str,
min: u64,
max: u64,
},
DecimalOutOfRange {
field: &'static str,
min: &'static str,
max: &'static str,
},
RequiredWhen {
field: &'static str,
condition: &'static str,
},
NotApplicable {
field: &'static str,
condition: &'static str,
},
AtLeastOneRequired {
fields: &'static str,
},
MutuallyExclusive {
fields: &'static str,
},
}Expand description
A validation failure detected before an HTTP request is sent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EmptyField
A required string field was empty.
TooLong
A string field exceeded the endpoint’s documented maximum length.
LengthOutOfRange
A string field’s length was outside the documented range.
Fields
InvalidFormat
A field did not match the endpoint’s required textual format.
Fields
OutOfRange
A numeric request value was outside the endpoint’s documented range.
Fields
DecimalOutOfRange
A decimal-string request value was outside the documented range.
Fields
RequiredWhen
A field is required under a particular condition.
Fields
NotApplicable
A field is not applicable under a particular condition.
Fields
AtLeastOneRequired
None of a set of conditionally required fields was provided.
MutuallyExclusive
More than one mutually exclusive field was provided.
Trait Implementations§
Source§impl Clone for RequestValidationError
impl Clone for RequestValidationError
Source§fn clone(&self) -> RequestValidationError
fn clone(&self) -> RequestValidationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestValidationError
impl Debug for RequestValidationError
Source§impl Display for RequestValidationError
impl Display for RequestValidationError
impl Eq for RequestValidationError
Source§impl Error for RequestValidationError
impl Error for RequestValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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 From<RequestValidationError> for Error
impl From<RequestValidationError> for Error
Source§fn from(source: RequestValidationError) -> Self
fn from(source: RequestValidationError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for RequestValidationError
impl PartialEq for RequestValidationError
Source§fn eq(&self, other: &RequestValidationError) -> bool
fn eq(&self, other: &RequestValidationError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RequestValidationError
Auto Trait Implementations§
impl Freeze for RequestValidationError
impl RefUnwindSafe for RequestValidationError
impl Send for RequestValidationError
impl Sync for RequestValidationError
impl Unpin for RequestValidationError
impl UnsafeUnpin for RequestValidationError
impl UnwindSafe for RequestValidationError
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