c_ares_resolver/nameinfo.rs
1/// An owned version of `c_ares::NameInfoResult`.
2#[derive(Clone, Eq, PartialEq, Debug, Hash, PartialOrd, Ord)]
3pub struct NameInfoResult {
4 /// The node returned by the lookup.
5 pub node: Option<String>,
6
7 /// The service returned by the lookup.
8 pub service: Option<String>,
9}
10
11impl From<c_ares::NameInfoResult<'_>> for NameInfoResult {
12 fn from(result: c_ares::NameInfoResult) -> Self {
13 Self {
14 node: result.node().map(std::borrow::ToOwned::to_owned),
15 service: result.service().map(std::borrow::ToOwned::to_owned),
16 }
17 }
18}