/// Add a subnet address and route, returning once the address' assignment state is `Assigned`.
Add a subnet address and route, returning once the address' assignment state is `Assigned`.
Add a subnet address and route returning once the address ' assignment state is ` Assigned ` .
pub async fn add_subnet_address_and_route_wait_assigned<'a>(
    iface: &'a netemul::TestInterface<'a>,
    subnet: fidl_fuchsia_net::Subnet,
    address_parameters: fidl_fuchsia_net_interfaces_admin::AddressParameters,
) -> Result<fidl_fuchsia_net_interfaces_admin::AddressStateProviderProxy> {
    let fidl_fuchsia_net::Subnet { addr, prefix_len } = subnet;
    let 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 (address_state_provider, ()) = futures::future::try_join(
        add_address_wait_assigned(iface.control(), address, address_parameters)
            .map(|res| res.context("add address")),
        iface.add_subnet_route(subnet),
    )
    .await?;
    Ok(address_state_provider)
}
pub async fn add_subnet_address_and_route_wait_assigned < ' a > ( iface : & ' a netemul :: TestInterface < ' a > , subnet : fidl_fuchsia_net :: Subnet , address_parameters : fidl_fuchsia_net_interfaces_admin :: AddressParameters , ) -> Result < fidl_fuchsia_net_interfaces_admin :: AddressStateProviderProxy > { let fidl_fuchsia_net :: Subnet { addr , prefix_len } = subnet ; let 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 ( address_state_provider , ( ) ) = futures :: future :: try_join ( add_address_wait_assigned ( iface . control ( ) , address , address_parameters ) . map ( | res | res . context ( " " ) ) , iface . add_subnet_route ( subnet ) , ) . await ? ; Ok ( address_state_provider ) }
Add a subnet address and route, returning once the address' assignment state is `Assigned`.
Add a subnet address and route returning once the address ' assignment state is ` Assigned ` .
iface
&'a netemul::TestInterface<'a>
subnet
fidl_fuchsia_net::Subnet
address_parameters
fidl_fuchsia_net_interfaces_admin::AddressParameters