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.
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> !RefUnwindSafe for Node<'a>
impl<'a> Send for Node<'a>
impl<'a> Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> !UnwindSafe for Node<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more