Error

Trait Error 

Source
pub trait Error:
    Sized
    + Error
    + From<Error> {
    // Required methods
    fn with_kind(self, kind: &'static str) -> Self;
    fn custom<T>(msg: T) -> Self
       where T: Display;

    // Provided methods
    fn invalid_type<U, E>(unexp: U, exp: E) -> Self
       where U: Display,
             E: Display { ... }
    fn invalid_value<U, E>(unexp: U, exp: E) -> Self
       where U: Display,
             E: Display { ... }
    fn invalid_length<E>(len: usize, exp: E) -> Self
       where E: Display { ... }
}

Required Methods§

Source

fn with_kind(self, kind: &'static str) -> Self

Source

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

Raised when there is general error when decoding a type.

Provided Methods§

Source

fn invalid_type<U, E>(unexp: U, exp: E) -> Self
where U: Display, E: Display,

Raised when receives a type different from what it was expecting.

Source

fn invalid_value<U, E>(unexp: U, exp: E) -> Self
where U: Display, E: Display,

Raised when receives a value of the right type but that is wrong for some other reason.

Source

fn invalid_length<E>(len: usize, exp: E) -> Self
where E: Display,

Raised when the input data contains too many or too few elements.

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§