async-resol-vbus 0.1.0

A Rust library for processing RESOL VBus data asynchronously.
Documentation
/// A common error type.
#[derive(Debug, PartialEq)]
pub struct Error {
    message: String,
}

/// A common result type.
pub type Result<T> = std::result::Result<T, Error>;

pub trait IntoError: std::fmt::Display {}

impl<T: IntoError> From<T> for Error {
    fn from(other: T) -> Error {
        let message = format!("{}", other);
        Error { message }
    }
}

impl IntoError for &str {}
impl IntoError for String {}
impl IntoError for std::io::Error {}
impl IntoError for std::net::AddrParseError {}
impl IntoError for std::str::Utf8Error {}