async_resol_vbus/
error.rs1#[derive(Debug, PartialEq)]
3pub struct Error {
4 message: String,
5}
6
7pub type Result<T> = std::result::Result<T, Error>;
9
10pub trait IntoError: std::fmt::Display {}
11
12impl<T: IntoError> From<T> for Error {
13 fn from(other: T) -> Error {
14 let message = format!("{}", other);
15 Error { message }
16 }
17}
18
19impl IntoError for &str {}
20impl IntoError for String {}
21impl IntoError for std::io::Error {}
22impl IntoError for std::net::AddrParseError {}
23impl IntoError for std::str::Utf8Error {}