Skip to main content

Error

Trait Error 

Source
pub trait Error: Error + Sized {
    // Required method
    fn custom<T>(msg: T) -> Self
       where T: Display;

    // Provided methods
    fn invalid_type(unexp: impl Display, exp: impl Display) -> Self { ... }
    fn missing_field(field: impl Display) -> Self { ... }
}
Expand description

Error type used by a deserializer.

Required Methods§

Source

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

A general error message during deserialization.

Provided Methods§

Source

fn invalid_type(unexp: impl Display, exp: impl Display) -> Self

Receives a type different from what it was expecting when visiting through a deserialization.

Source

fn missing_field(field: impl Display) -> Self

One or more fields are missing in the provided arguments during deserializer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Error for Infallible

Source§

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

Implementors§