google-dns-rs 0.3.0

google-dns-rs is a third party Google DNS client for rust
Documentation
use std::{fmt, io};

#[derive(Debug)]
pub enum Error {
    Http(ureq::Error),
    IO(io::Error),
}

impl From<ureq::Error> for Error {
    fn from(e: ureq::Error) -> Self {
        Self::Http(e)
    }
}

impl std::error::Error for Error {}

impl From<io::Error> for Error {
    fn from(e: io::Error) -> Self {
        Self::IO(e)
    }
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::Http(e) => write!(f, "Http Error: {}", e),
            Self::IO(e) => write!(f, "{}", e),
        }
    }
}