pub struct MplsLabel(pub u32);Expand description
A 3-byte MPLS label field (RFC 3032) as carried in EVPN NLRI.
For VXLAN-encapsulated EVPN (RFC 8365), the 24-bit label field carries a 24-bit VNI. The codec does not distinguish — consumers interpret the value based on the Encapsulation extended community.
Tuple Fields§
§0: u32Implementations§
Source§impl MplsLabel
impl MplsLabel
Sourcepub const fn as_vni(&self) -> u32
pub const fn as_vni(&self) -> u32
Interpret this field as a VXLAN VNI (RFC 8365 §5).
The label field on the wire is (label << 4) | (TC << 1) | S when
used for MPLS, but for VXLAN the full 24 bits are the VNI. Both
uses call this accessor; it’s up to the caller to know the encap.
Sourcepub const fn as_mpls_label(&self) -> u32
pub const fn as_mpls_label(&self) -> u32
Extract the 20-bit MPLS label field (upper 20 bits of the 24-bit word).
Trait Implementations§
impl Copy for MplsLabel
impl Eq for MplsLabel
Source§impl Ord for MplsLabel
impl Ord for MplsLabel
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 MplsLabel
impl PartialOrd for MplsLabel
impl StructuralPartialEq for MplsLabel
Auto Trait Implementations§
impl Freeze for MplsLabel
impl RefUnwindSafe for MplsLabel
impl Send for MplsLabel
impl Sync for MplsLabel
impl Unpin for MplsLabel
impl UnsafeUnpin for MplsLabel
impl UnwindSafe for MplsLabel
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