pub struct TypeValidationError {
pub value: JsonValue,
pub context: Option<Box<TypeValidationContext>>,
pub cause: BoxError,
}Expand description
A value failed schema or type validation.
Fields§
§value: JsonValueThe offending value.
context: Option<Box<TypeValidationContext>>Where the value came from (boxed to keep the error small).
cause: BoxErrorThe validation error.
Implementations§
Source§impl TypeValidationError
impl TypeValidationError
Sourcepub fn new(value: JsonValue, cause: impl Error + Send + Sync + 'static) -> Self
pub fn new(value: JsonValue, cause: impl Error + Send + Sync + 'static) -> Self
Creates an error for value caused by cause.
Sourcepub fn with_context(self, context: TypeValidationContext) -> Self
pub fn with_context(self, context: TypeValidationContext) -> Self
Sets the validation context.
Sourcepub fn wrap(
value: JsonValue,
cause: BoxError,
context: Option<TypeValidationContext>,
) -> Self
pub fn wrap( value: JsonValue, cause: BoxError, context: Option<TypeValidationContext>, ) -> Self
Wraps cause unless it already is a TypeValidationError for the
same value and context, in which case it is returned unchanged.
Trait Implementations§
Source§impl Debug for TypeValidationError
impl Debug for TypeValidationError
Source§impl Display for TypeValidationError
impl Display for TypeValidationError
Source§impl Error for TypeValidationError
impl Error for TypeValidationError
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<TypeValidationError> for ProviderError
impl From<TypeValidationError> for ProviderError
Source§fn from(source: TypeValidationError) -> Self
fn from(source: TypeValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TypeValidationError
impl !UnwindSafe for TypeValidationError
impl Freeze for TypeValidationError
impl Send for TypeValidationError
impl Sync for TypeValidationError
impl Unpin for TypeValidationError
impl UnsafeUnpin for TypeValidationError
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