pub struct Node<'a> { /* private fields */ }
Expand description
A realm and associated data as a helper for issuing pings in tests.
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
Sourcepub fn new(
realm: &'a TestRealm<'_>,
local_interface_id: u64,
v4_addrs: Vec<Ipv4Addr>,
v6_addrs: Vec<Ipv6Addr>,
) -> Self
pub fn new( realm: &'a TestRealm<'_>, local_interface_id: u64, v4_addrs: Vec<Ipv4Addr>, v6_addrs: Vec<Ipv6Addr>, ) -> Self
Constructs a new Node
.
Sourcepub async fn new_with_wait_addr<F: FnMut(&[Address<DefaultInterest>]) -> Option<(Vec<Ipv4Addr>, Vec<Ipv6Addr>)>>(
realm: &'a TestRealm<'_>,
interface: &'a TestInterface<'_>,
addr_predicate: F,
) -> Result<Node<'a>>
pub async fn new_with_wait_addr<F: FnMut(&[Address<DefaultInterest>]) -> Option<(Vec<Ipv4Addr>, Vec<Ipv6Addr>)>>( realm: &'a TestRealm<'_>, interface: &'a TestInterface<'_>, addr_predicate: F, ) -> Result<Node<'a>>
Create a new Node
, waiting for addresses to satisfy the provided
predicate.
Addresses changes on interface
will be observed via a watcher, and
addr_predicate
will be called with the addresses until the returned
value is Some
, and the vector of addresses will be used as the local
addresses for this Node
.
Sourcepub async fn new_with_v4_and_v6_link_local(
realm: &'a TestRealm<'_>,
interface: &'a TestInterface<'_>,
) -> Result<Node<'a>>
pub async fn new_with_v4_and_v6_link_local( realm: &'a TestRealm<'_>, interface: &'a TestInterface<'_>, ) -> Result<Node<'a>>
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.