Struct jsonschema_valid_compat::ValidationError [−][src]
An error that can occur during validation.
Fields
msg: String
The error message.
instance: Option<Value>
The JSON instance fragment that had the issue.
schema: Option<Value>
The JSON schema fragment that had the issue.
instance_path: Vec<String>
The path to the JSON instance fragment within the entire instance document.
schema_path: Vec<String>
The path to the JSON schema fragment within the entire schema.
Implementations
impl ValidationError
[src]
Stores information about a single validation error.
pub fn new(
msg: &str,
instance: Option<&Value>,
schema: Option<&Value>
) -> ValidationError
[src]
msg: &str,
instance: Option<&Value>,
schema: Option<&Value>
) -> ValidationError
Create a new validation error with the given error message.
pub fn add_ctx(self, instance_context: String, schema_context: String) -> Self
[src]
Update the instance and schema context for the error.
pub fn instance_ctx(self, instance_context: String) -> Self
[src]
Update the instance context for the error.
pub fn schema_ctx(self, schema_context: String) -> Self
[src]
Update the schema context for the error.
Trait Implementations
impl Clone for ValidationError
[src]
fn clone(&self) -> ValidationError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ValidationError
[src]
impl Default for ValidationError
[src]
fn default() -> ValidationError
[src]
impl Display for ValidationError
[src]
impl Error for ValidationError
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<ParseError> for ValidationError
[src]
fn from(err: ParseError) -> ValidationError
[src]
Auto Trait Implementations
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnwindSafe for ValidationError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,