async fn resolve(name: &str) -> Result<String, Error> {
    let mut ips = lookup_host(name).await.context(ResolveServer {
        server: name.to_owned(),
    })?;
    match ips.next() {
        None => Err(Error::ResolveServerEmpty {
            server: name.to_owned(),
        }),
        Some(ip) => Ok(ip.to_string()),
    }
}
/// Resolve a hostname or return an error.
Resolve a hostname or return an error.
Resolve a hostname or return an error .
async fn resolve(name: &str) -> Result<String, Error> {
    let mut ips = lookup_host(name).await.context(ResolveServer {
        server: name.to_owned(),
    })?;
    match ips.next() {
        None => Err(Error::ResolveServerEmpty {
            server: name.to_owned(),
        }),
        Some(ip) => Ok(ip.to_string()),
    }
}
async fn resolve ( name : & str ) -> Result < String , Error > { let mut ips = lookup_host ( name ) . await . context ( ResolveServer { server : name . to_owned ( ) , } ) ? ; match ips . next ( ) { None => Err ( Error :: ResolveServerEmpty { server : name . to_owned ( ) , } ) , Some ( ip ) => Ok ( ip . to_string ( ) ) , } }
Resolve a hostname or return an error.
Resolve a hostname or return an error .
name
&str
name
&str