/// Waits for a `SetDnsServers` request with the specified servers.
Waits for a `SetDnsServers` request with the specified servers.
Waits for a ` SetDnsServers ` request with the specified servers .
async fn run_lookup_admin_once(
            server: &mut fnet_name::LookupAdminRequestStream,
            expected_servers: &Vec<fnet::SocketAddress>,
        ) -> Result<(), anyhow::Error> {
            let req = server
                .try_next()
                .await
                .context("error getting next lookup admin request")?
                .ok_or(anyhow::anyhow!("expected lookup admin request"))?;
            if let fnet_name::LookupAdminRequest::SetDnsServers { servers, responder } = req {
                if expected_servers != &servers {
                    return Err(anyhow::anyhow!(
                        "got SetDnsServers servers = {:?}, want = {:?}",
                        servers,
                        expected_servers
                    ));
                }
                responder.send(&mut Ok(())).context("error sending set dns servers response")
            } else {
                Err(anyhow::anyhow!("unknown request = {:?}", req))
            }
        }
async fn run_lookup_admin_once ( server : & mut fnet_name :: LookupAdminRequestStream , expected_servers : & Vec < fnet :: SocketAddress > , ) -> Result < ( ) , anyhow :: Error > { let req = server . try_next ( ) . await . context ( " " ) ? . ok_or ( anyhow :: anyhow ! ( " " ) ) ? ; if let fnet_name :: LookupAdminRequest :: SetDnsServers { servers , responder } = req { if expected_servers != & servers { return Err ( anyhow :: anyhow ! ( " " servers expected_servers ) ) ; } responder . send ( & mut Ok ( ( ) ) ) . context ( " " ) } else { Err ( anyhow :: anyhow ! ( " " req ) ) } }
Waits for a `SetDnsServers` request with the specified servers.
Waits for a ` SetDnsServers ` request with the specified servers .
server
&mut fnet_name::LookupAdminRequestStream
expected_servers
&Vec<fnet::SocketAddress>