/// Remove a subnet address and route, returning true if the address was removed.
Remove a subnet address and route, returning true if the address was removed.
Remove a subnet address and route returning true if the address was removed .
pub async fn remove_subnet_address_and_route<'a>(
    iface: &'a netemul::TestInterface<'a>,
    subnet: fidl_fuchsia_net::Subnet,
) -> Result<bool> {
    let fidl_fuchsia_net::Subnet { addr, prefix_len } = subnet;
    let mut address = match addr {
        fidl_fuchsia_net::IpAddress::Ipv4(addr) => {
            fidl_fuchsia_net::InterfaceAddress::Ipv4(fidl_fuchsia_net::Ipv4AddressWithPrefix {
                addr,
                prefix_len,
            })
        }
        fidl_fuchsia_net::IpAddress::Ipv6(addr) => fidl_fuchsia_net::InterfaceAddress::Ipv6(addr),
    };
    let (did_remove, ()) = futures::future::try_join(
        iface.control().remove_address(&mut address).map_err(anyhow::Error::new).and_then(|res| {
            futures::future::ready(res.map_err(
                |e: fidl_fuchsia_net_interfaces_admin::ControlRemoveAddressError| {
                    anyhow::anyhow!("{:?}", e)
                },
            ))
        }),
        iface.del_subnet_route(subnet),
    )
    .await?;
    Ok(did_remove)
}
pub async fn remove_subnet_address_and_route < ' a > ( iface : & ' a netemul :: TestInterface < ' a > , subnet : fidl_fuchsia_net :: Subnet , ) -> Result < bool > { let fidl_fuchsia_net :: Subnet { addr , prefix_len } = subnet ; let mut address = match addr { fidl_fuchsia_net :: IpAddress :: Ipv4 ( addr ) => { fidl_fuchsia_net :: InterfaceAddress :: Ipv4 ( fidl_fuchsia_net :: Ipv4AddressWithPrefix { addr , prefix_len , } ) } fidl_fuchsia_net :: IpAddress :: Ipv6 ( addr ) => fidl_fuchsia_net :: InterfaceAddress :: Ipv6 ( addr ) , } ; let ( did_remove , ( ) ) = futures :: future :: try_join ( iface . control ( ) . remove_address ( & mut address ) . map_err ( anyhow :: Error :: new ) . and_then ( | res | { futures :: future :: ready ( res . map_err ( | e : fidl_fuchsia_net_interfaces_admin :: ControlRemoveAddressError | { anyhow :: anyhow ! ( " " e ) } , ) ) } ) , iface . del_subnet_route ( subnet ) , ) . await ? ; Ok ( did_remove ) }
Remove a subnet address and route, returning true if the address was removed.
Remove a subnet address and route returning true if the address was removed .
iface
&'a netemul::TestInterface<'a>
subnet
fidl_fuchsia_net::Subnet