pub enum SchemaError {
UnsupportedType {
type_name: String,
format: String,
},
CircularReference {
path: String,
},
TypeNotFound {
type_name: String,
},
InvalidAttribute {
message: String,
},
ConflictingAttributes {
attr1: String,
attr2: String,
},
InvalidConstraint {
message: String,
},
Io(Error),
Serialization(String),
Deserialization(String),
Multiple(Vec<SchemaError>),
Custom(String),
}Variants§
UnsupportedType
CircularReference
TypeNotFound
InvalidAttribute
ConflictingAttributes
InvalidConstraint
Io(Error)
Serialization(String)
Deserialization(String)
Multiple(Vec<SchemaError>)
Custom(String)
Implementations§
Source§impl SchemaError
impl SchemaError
pub fn unsupported_type( type_name: impl Into<String>, format: impl Into<String>, ) -> SchemaError
pub fn circular_reference( path: impl IntoIterator<Item = impl AsRef<str>>, ) -> SchemaError
pub fn type_not_found(type_name: impl Into<String>) -> SchemaError
pub fn invalid_attribute(message: impl Into<String>) -> SchemaError
pub fn conflicting_attributes( attr1: impl Into<String>, attr2: impl Into<String>, ) -> SchemaError
pub fn invalid_constraint(message: impl Into<String>) -> SchemaError
pub fn custom(message: impl Into<String>) -> SchemaError
pub fn multiple(errors: Vec<SchemaError>) -> SchemaError
pub fn is_unsupported_type(&self) -> bool
pub fn is_type_not_found(&self) -> bool
pub fn is_multiple(&self) -> bool
pub fn inner_errors(&self) -> Option<&[SchemaError]>
Trait Implementations§
Source§impl Debug for SchemaError
impl Debug for SchemaError
Source§impl Display for SchemaError
impl Display for SchemaError
Source§impl Error for SchemaError
impl Error for SchemaError
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<Error> for SchemaError
impl From<Error> for SchemaError
Source§fn from(source: Error) -> SchemaError
fn from(source: Error) -> SchemaError
Converts to this type from the input type.
Source§impl From<Error> for SchemaError
impl From<Error> for SchemaError
Source§fn from(err: Error) -> SchemaError
fn from(err: Error) -> SchemaError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SchemaError
impl !RefUnwindSafe for SchemaError
impl Send for SchemaError
impl Sync for SchemaError
impl Unpin for SchemaError
impl !UnwindSafe for SchemaError
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