use crate::config::setopt::{EasyHandle, SetOpt, SetOptError};
mod dial;
pub mod dns;
pub mod interface;
pub use dial::{Dialer, DialerParseError};
#[derive(Clone, Debug)]
pub enum IpVersion {
V4,
V6,
Any,
}
impl Default for IpVersion {
fn default() -> Self {
Self::Any
}
}
impl SetOpt for IpVersion {
fn set_opt(&self, easy: &mut EasyHandle) -> Result<(), SetOptError> {
easy.ip_resolve(match &self {
IpVersion::V4 => curl::easy::IpResolve::V4,
IpVersion::V6 => curl::easy::IpResolve::V6,
IpVersion::Any => curl::easy::IpResolve::Any,
})?;
Ok(())
}
}