pub enum VpnPrefix {
V4 {
addr: Ipv4Addr,
len: u8,
},
V6 {
addr: Ipv6Addr,
len: u8,
},
}Expand description
A VPNv4 or VPNv6 route prefix keyed by RD plus address prefix.
This is intentionally not crate::nlri::Prefix. VPN route identity is
different from ordinary IPv4/IPv6 unicast because the Route Distinguisher is
part of the address-family-specific route key.
Variants§
Implementations§
Source§impl VpnPrefix
impl VpnPrefix
Sourcepub fn v6(addr: Ipv6Addr, len: u8) -> Result<Self, EncodeError>
pub fn v6(addr: Ipv6Addr, len: u8) -> Result<Self, EncodeError>
Create a canonical VPN-IPv6 prefix.
§Errors
Returns EncodeError::ValueOutOfRange if len exceeds 128.
Sourcepub const fn family(&self) -> VpnAddressFamily
pub const fn family(&self) -> VpnAddressFamily
Return the VPN address family.
Trait Implementations§
impl Copy for VpnPrefix
impl Eq for VpnPrefix
Source§impl Ord for VpnPrefix
impl Ord for VpnPrefix
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for VpnPrefix
impl PartialOrd for VpnPrefix
impl StructuralPartialEq for VpnPrefix
Auto Trait Implementations§
impl Freeze for VpnPrefix
impl RefUnwindSafe for VpnPrefix
impl Send for VpnPrefix
impl Sync for VpnPrefix
impl Unpin for VpnPrefix
impl UnsafeUnpin for VpnPrefix
impl UnwindSafe for VpnPrefix
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