use std::net::IpAddr;
#[derive(Clone, Eq, PartialEq, Debug, Hash, PartialOrd, Ord)]
pub struct HostResults {
pub hostname: String,
pub addresses: Vec<IpAddr>,
pub aliases: Vec<String>,
}
impl From<c_ares::HostResults<'_>> for HostResults {
fn from(results: c_ares::HostResults) -> Self {
Self {
hostname: results.hostname().to_owned(),
addresses: results.addresses().collect(),
aliases: results
.aliases()
.map(std::borrow::ToOwned::to_owned)
.collect(),
}
}
}