pub struct MplsLabel(/* private fields */);Expand description
MPLS Label value (20-bit, 0-1,048,575)
Implementations§
Source§impl MplsLabel
impl MplsLabel
Sourcepub const IPV4_EXPLICIT_NULL: u32 = 0
pub const IPV4_EXPLICIT_NULL: u32 = 0
IPv4 Explicit NULL label (RFC 3032)
Sourcepub const IPV6_EXPLICIT_NULL: u32 = 2
pub const IPV6_EXPLICIT_NULL: u32 = 2
IPv6 Explicit NULL label (RFC 3032)
Sourcepub const IMPLICIT_NULL: u32 = 3
pub const IMPLICIT_NULL: u32 = 3
Implicit NULL label (RFC 3032)
Sourcepub fn try_new(value: u32) -> Result<Self, MplsLabelError>
pub fn try_new(value: u32) -> Result<Self, MplsLabelError>
Create a new MplsLabel with validation. Returns Err if value exceeds 20-bit range.
Sourcepub fn is_reserved(&self) -> bool
pub fn is_reserved(&self) -> bool
Check if label is in reserved range (0-15 per RFC 3032)
Sourcepub fn is_implicit_null(&self) -> bool
pub fn is_implicit_null(&self) -> bool
Check if label is Implicit NULL (value 3)
Sourcepub fn is_ipv4_explicit_null(&self) -> bool
pub fn is_ipv4_explicit_null(&self) -> bool
Check if label is IPv4 Explicit NULL (value 0)
Sourcepub fn is_ipv6_explicit_null(&self) -> bool
pub fn is_ipv6_explicit_null(&self) -> bool
Check if label is IPv6 Explicit NULL (value 2)
Trait Implementations§
impl Copy for MplsLabel
impl Eq 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
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