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 unsupported_type(ty: impl Display) -> Self { ... }
    fn missing_field(field: impl Display) -> Self { ... }
}
Expand description

Error type used by a serializer.

Required Methods§

Source

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

A general error message during serialization.

Provided Methods§

Source

fn unsupported_type(ty: impl Display) -> Self

Ran into an element type that is not supported by the serializer.

Source

fn missing_field(field: impl Display) -> Self

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

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§