pub struct MplsLabelEntry {
pub label: u32,
pub traffic_class: u8,
pub bottom_of_stack: bool,
}Expand description
One RFC 8277 MPLS label-stack entry.
Fields§
§label: u32The 20-bit MPLS label value.
traffic_class: u8The 3-bit traffic-class field.
bottom_of_stack: boolBottom-of-stack bit.
Implementations§
Source§impl MplsLabelEntry
impl MplsLabelEntry
Sourcepub fn try_new(
label: u32,
traffic_class: u8,
bottom_of_stack: bool,
) -> Result<Self, EncodeError>
pub fn try_new( label: u32, traffic_class: u8, bottom_of_stack: bool, ) -> Result<Self, EncodeError>
Construct a validated MPLS label-stack entry.
§Errors
Returns EncodeError::ValueOutOfRange when label exceeds 20 bits
or traffic_class exceeds 3 bits.
Sourcepub fn raw_value(&self) -> Result<u32, EncodeError>
pub fn raw_value(&self) -> Result<u32, EncodeError>
Encode this entry as a raw 24-bit wire value.
§Errors
Returns EncodeError::ValueOutOfRange if the public fields contain
out-of-range values.
Trait Implementations§
Source§impl Clone for MplsLabelEntry
impl Clone for MplsLabelEntry
Source§fn clone(&self) -> MplsLabelEntry
fn clone(&self) -> MplsLabelEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MplsLabelEntry
Source§impl Debug for MplsLabelEntry
impl Debug for MplsLabelEntry
impl Eq for MplsLabelEntry
Source§impl Hash for MplsLabelEntry
impl Hash for MplsLabelEntry
Source§impl Ord for MplsLabelEntry
impl Ord for MplsLabelEntry
Source§fn cmp(&self, other: &MplsLabelEntry) -> Ordering
fn cmp(&self, other: &MplsLabelEntry) -> Ordering
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 PartialEq for MplsLabelEntry
impl PartialEq for MplsLabelEntry
Source§fn eq(&self, other: &MplsLabelEntry) -> bool
fn eq(&self, other: &MplsLabelEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MplsLabelEntry
impl PartialOrd for MplsLabelEntry
impl StructuralPartialEq for MplsLabelEntry
Auto Trait Implementations§
impl Freeze for MplsLabelEntry
impl RefUnwindSafe for MplsLabelEntry
impl Send for MplsLabelEntry
impl Sync for MplsLabelEntry
impl Unpin for MplsLabelEntry
impl UnsafeUnpin for MplsLabelEntry
impl UnwindSafe for MplsLabelEntry
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