pub struct Nlri {
pub afi: Afi,
pub safi: Safi,
pub next_hop: Option<NextHopAddress>,
pub prefixes: Vec<NetworkPrefix>,
}
Expand description
Network Layer Reachability Information
Fields§
§afi: Afi
§safi: Safi
§next_hop: Option<NextHopAddress>
§prefixes: Vec<NetworkPrefix>
Implementations§
Source§impl Nlri
impl Nlri
Sourcepub const fn is_ipv4(&self) -> bool
pub const fn is_ipv4(&self) -> bool
Returns true if this NLRI refers to the IPv4 address space.
Sourcepub const fn is_ipv6(&self) -> bool
pub const fn is_ipv6(&self) -> bool
Returns true if this NLRI refers to the IPv6 address space.
Sourcepub const fn is_reachable(&self) -> bool
pub const fn is_reachable(&self) -> bool
Returns true if this NLRI refers to reachable prefixes
Sourcepub const fn next_hop_addr(&self) -> IpAddr
pub const fn next_hop_addr(&self) -> IpAddr
Get the address of the next hop indicated by this NLRI.
Panics if used on a unreachable NLRI message (ie. there is no next hop).
pub fn new_reachable(prefix: NetworkPrefix, next_hop: Option<IpAddr>) -> Nlri
pub fn new_unreachable(prefix: NetworkPrefix) -> Nlri
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Nlri
impl<'a> IntoIterator for &'a Nlri
Source§impl IntoIterator for Nlri
impl IntoIterator for Nlri
impl Eq for Nlri
impl StructuralPartialEq for Nlri
Auto Trait Implementations§
impl Freeze for Nlri
impl RefUnwindSafe for Nlri
impl Send for Nlri
impl Sync for Nlri
impl Unpin for Nlri
impl UnwindSafe for Nlri
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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