pub async fn new_with_v4_and_v6_link_local(
        realm: &'a netemul::TestRealm<'_>,
        interface: &'a netemul::TestInterface<'_>,
    ) -> Result<Node<'a>> {
        Self::new_with_wait_addr(realm, interface, |addresses| {
            let (v4, v6) = addresses.into_iter().fold(
                (None, None),
                |(v4, v6), &fidl_fuchsia_net_interfaces_ext::Address { value, valid_until: _ }| {
                    match value {
                        fidl_fuchsia_net::InterfaceAddress::Ipv4(
                            fidl_fuchsia_net::Ipv4AddressWithPrefix {
                                addr: fidl_fuchsia_net::Ipv4Address { addr },
                                prefix_len: _,
                            },
                        ) => (Some(net_types::ip::Ipv4Addr::from(addr)), v6),
                        fidl_fuchsia_net::InterfaceAddress::Ipv6(
                            fidl_fuchsia_net::Ipv6Address { addr },
                        ) => {
                            let v6_candidate = net_types::ip::Ipv6Addr::from_bytes(addr);
                            if v6_candidate.is_unicast_link_local() {
                                (v4, Some(v6_candidate))
                            } else {
                                (v4, v6)
                            }
                        }
                    }
                },
            );
            match (v4, v6) {
                (Some(v4), Some(v6)) => Some((vec![v4], vec![v6])),
                _ => None,
            }
        })
        .await
    }
/// Create a new [`Node`] with one IPv4 address and one IPv6 link-local
/// address.
///
/// Note that if there are multiple addresses of either kind assigned to
/// the interface, the specific address chosen is potentially
/// non-deterministic. Callers that care about specific addresses being
/// included rather than any IPv4 address and any IPv6 link-local address
/// should prefer [`Self::new_with_wait_addr`] instead.
Create a new [`Node`] with one IPv4 address and one IPv6 link-local
address.

Note that if there are multiple addresses of either kind assigned to
the interface, the specific address chosen is potentially
non-deterministic. Callers that care about specific addresses being
included rather than any IPv4 address and any IPv6 link-local address
should prefer [`Self::new_with_wait_addr`] instead.
Create a new [ ` Node ` ] with one IPv4 address and one IPv6 link - local address . Note that if there are multiple addresses of either kind assigned to the interface the specific address chosen is potentially non - deterministic . Callers that care about specific addresses being included rather than any IPv4 address and any IPv6 link - local address should prefer [ ` Self :: new_with_wait_addr ` ] instead .
pub async fn new_with_v4_and_v6_link_local(
        realm: &'a netemul::TestRealm<'_>,
        interface: &'a netemul::TestInterface<'_>,
    ) -> Result<Node<'a>> {
        Self::new_with_wait_addr(realm, interface, |addresses| {
            let (v4, v6) = addresses.into_iter().fold(
                (None, None),
                |(v4, v6), &fidl_fuchsia_net_interfaces_ext::Address { value, valid_until: _ }| {
                    match value {
                        fidl_fuchsia_net::InterfaceAddress::Ipv4(
                            fidl_fuchsia_net::Ipv4AddressWithPrefix {
                                addr: fidl_fuchsia_net::Ipv4Address { addr },
                                prefix_len: _,
                            },
                        ) => (Some(net_types::ip::Ipv4Addr::from(addr)), v6),
                        fidl_fuchsia_net::InterfaceAddress::Ipv6(
                            fidl_fuchsia_net::Ipv6Address { addr },
                        ) => {
                            let v6_candidate = net_types::ip::Ipv6Addr::from_bytes(addr);
                            if v6_candidate.is_unicast_link_local() {
                                (v4, Some(v6_candidate))
                            } else {
                                (v4, v6)
                            }
                        }
                    }
                },
            );
            match (v4, v6) {
                (Some(v4), Some(v6)) => Some((vec![v4], vec![v6])),
                _ => None,
            }
        })
        .await
    }
pub async fn new_with_v4_and_v6_link_local ( realm : & ' a netemul :: TestRealm < ' _ > , interface : & ' a netemul :: TestInterface < ' _ > , ) -> Result < Node < ' a > > { Self :: new_with_wait_addr ( realm , interface , | addresses | { let ( v4 , v6 ) = addresses . into_iter ( ) . fold ( ( None , None ) , | ( v4 , v6 ) , & fidl_fuchsia_net_interfaces_ext :: Address { value , valid_until : _ } | { match value { fidl_fuchsia_net :: InterfaceAddress :: Ipv4 ( fidl_fuchsia_net :: Ipv4AddressWithPrefix { addr : fidl_fuchsia_net :: Ipv4Address { addr } , prefix_len : _ , } , ) => ( Some ( net_types :: ip :: Ipv4Addr :: from ( addr ) ) , v6 ) , fidl_fuchsia_net :: InterfaceAddress :: Ipv6 ( fidl_fuchsia_net :: Ipv6Address { addr } , ) => { let v6_candidate = net_types :: ip :: Ipv6Addr :: from_bytes ( addr ) ; if v6_candidate . is_unicast_link_local ( ) { ( v4 , Some ( v6_candidate ) ) } else { ( v4 , v6 ) } } } } , ) ; match ( v4 , v6 ) { ( Some ( v4 ) , Some ( v6 ) ) => Some ( ( vec ! [ v4 ] , vec ! [ v6 ] ) ) , _ => None , } } ) . await }
Create a new [`Node`] with one IPv4 address and one IPv6 link-local
address.
Create a new [ ` Node ` ] with one IPv4 address and one IPv6 link - local address .
realm
&'a netemul::TestRealm<'_>
interface
&'a netemul::TestInterface<'_>
realm
&'a netemul::TestRealm<'_>
interface
&'a netemul::TestInterface<'_>