#[derive(Debug)] pub struct Error { inner: std::io::Error, } impl std::convert::From for std::io::Error { fn from(e: Error) -> Self { e.inner } } impl std::convert::From for Error { fn from(inner: std::io::Error) -> Self { Error { inner } } } impl serde::ser::Error for Error { fn custom(msg: T) -> Self { Error { inner: std::io::Error::new(std::io::ErrorKind::Other, msg.to_string()) } } } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::result::Result<(), std::fmt::Error> { self.inner.fmt(f) } } impl std::error::Error for Error {}