use core::fmt;
pub use std::error::Error as StdError;
use std::io;
pub trait Error: Sized + StdError + From<io::Error> {
fn with_kind(self, kind: &'static str) -> Self;
fn custom<T: fmt::Display>(msg: T) -> Self;
fn invalid_type<U: fmt::Display, E: fmt::Display>(unexp: U, exp: E) -> Self {
Self::custom(format_args!("invalid type: {}, expected {}", unexp, exp))
}
fn invalid_value<U: fmt::Display, E: fmt::Display>(unexp: U, exp: E) -> Self {
Self::custom(format_args!("invalid value: {}, expected {}", unexp, exp))
}
fn invalid_length<E: fmt::Display>(len: usize, exp: E) -> Self {
Self::custom(format_args!("invalid length: {}, expected {}", len, exp))
}
}