use crate::{IpType, Provider}; use std::convert::From; #[derive(Debug)] pub enum Error { Unsupported(IpType, Provider), Http(http::Error), #[cfg(feature = "reqwest-client")] Reqwest(reqwest::Error), } impl From<(IpType, &Provider)> for Error { fn from(tuple: (IpType, &Provider)) -> Self { Self::Unsupported(tuple.0, tuple.1.clone()) } } impl From for Error { fn from(error: http::Error) -> Self { Self::Http(error) } } #[cfg(feature = "reqwest-client")] impl From for Error { fn from(error: reqwest::Error) -> Self { Self::Reqwest(error) } }