Trait Error

Source
pub trait Error: Sized + StdError {
    // Required methods
    fn custom<T>(msg: T) -> Self
       where T: Display;
    fn wrong_name(name: &ExpandedName<'_>, expected: &ExpandedName<'_>) -> Self;
    fn unexpected_visit<T>(unexpected: Unexpected, expected: &T) -> Self;
    fn missing_field(field: &str) -> Self;
    fn no_possible_variant(ident: &str) -> Self;
    fn missing_data() -> Self;
    fn unknown_child() -> Self;
    fn invalid_string() -> Self;
}
Expand description

A trait for errors that can be returned by a Deserializer.

Required Methods§

Source

fn custom<T>(msg: T) -> Self
where T: Display,

Error for when a custom error occurs during deserialization.

Source

fn wrong_name(name: &ExpandedName<'_>, expected: &ExpandedName<'_>) -> Self

Error for when a name is expected to be a certain value, but it is not.

Source

fn unexpected_visit<T>(unexpected: Unexpected, expected: &T) -> Self

Error for when a type is expected to be a certain type, but it is not.

Source

fn missing_field(field: &str) -> Self

Error for when a field is missing.

Source

fn no_possible_variant(ident: &str) -> Self

Error for when a type has no possible variants to deserialize into.

Source

fn missing_data() -> Self

Error for when a type is missing data that is required to deserialize it.

Source

fn unknown_child() -> Self

Error for when a child cannot be identified, and ignoring it is not allowed.

Source

fn invalid_string() -> Self

Error for when a string is invalid for the type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§