#[non_exhaustive]pub enum ValidationReason {
Missing,
OutOfRange {
details: &'static str,
},
BadShape {
details: &'static str,
},
Precondition {
details: &'static str,
},
}Expand description
Canonical validation-failure modes emitted by structured error variants.
Variants carry &'static str detail slots where applicable so consumers
get actionable context without paying the cost of a heap allocation.
Missing names the field itself as the whole reason; structured call
sites still carry a field: &'static str alongside this enum to make the
combination self-describing.
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.
Missing
The field was required but was not supplied.
OutOfRange
The field was out of the documented acceptable range.
BadShape
The field did not match the documented shape or format.
Precondition
The field violated a documented precondition for the operation.
Trait Implementations§
Source§impl Clone for ValidationReason
impl Clone for ValidationReason
Source§fn clone(&self) -> ValidationReason
fn clone(&self) -> ValidationReason
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 ValidationReason
impl Debug for ValidationReason
Source§impl Display for ValidationReason
impl Display for ValidationReason
impl Eq for ValidationReason
Source§impl Error for ValidationReason
impl Error for ValidationReason
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 PartialEq for ValidationReason
impl PartialEq for ValidationReason
Source§fn eq(&self, other: &ValidationReason) -> bool
fn eq(&self, other: &ValidationReason) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ValidationReason
Auto Trait Implementations§
impl Freeze for ValidationReason
impl RefUnwindSafe for ValidationReason
impl Send for ValidationReason
impl Sync for ValidationReason
impl Unpin for ValidationReason
impl UnsafeUnpin for ValidationReason
impl UnwindSafe for ValidationReason
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.