Struct etherparse::SingleVlanHeaderSlice
source · pub struct SingleVlanHeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing a single vlan header of a network package.
Implementations§
source§impl<'a> SingleVlanHeaderSlice<'a>
impl<'a> SingleVlanHeaderSlice<'a>
sourcepub fn from_slice(
slice: &'a [u8]
) -> Result<SingleVlanHeaderSlice<'a>, LenError>
pub fn from_slice( slice: &'a [u8] ) -> Result<SingleVlanHeaderSlice<'a>, LenError>
Creates a vlan header slice from a slice.
sourcepub fn priority_code_point(&self) -> VlanPcp
pub fn priority_code_point(&self) -> VlanPcp
Read the “priority_code_point” field from the slice. This is a 3 bit number which refers to the IEEE 802.1p class of service and maps to the frame priority level.
sourcepub fn drop_eligible_indicator(&self) -> bool
pub fn drop_eligible_indicator(&self) -> bool
Read the “drop_eligible_indicator” flag from the slice. Indicates that the frame may be dropped under the presence of congestion.
sourcepub fn vlan_identifier(&self) -> VlanId
pub fn vlan_identifier(&self) -> VlanId
Reads the 12 bits “vland identifier” field from the slice.
sourcepub fn ether_type(&self) -> EtherType
pub fn ether_type(&self) -> EtherType
Read the “Tag protocol identifier” field from the slice. Refer to the “EtherType” for a list of possible supported values.
sourcepub fn to_header(&self) -> SingleVlanHeader
pub fn to_header(&self) -> SingleVlanHeader
Decode all the fields and copy the results to a SingleVlanHeader struct
Trait Implementations§
source§impl<'a> Clone for SingleVlanHeaderSlice<'a>
impl<'a> Clone for SingleVlanHeaderSlice<'a>
source§fn clone(&self) -> SingleVlanHeaderSlice<'a>
fn clone(&self) -> SingleVlanHeaderSlice<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for SingleVlanHeaderSlice<'a>
impl<'a> Debug for SingleVlanHeaderSlice<'a>
source§impl<'a> PartialEq for SingleVlanHeaderSlice<'a>
impl<'a> PartialEq for SingleVlanHeaderSlice<'a>
source§fn eq(&self, other: &SingleVlanHeaderSlice<'a>) -> bool
fn eq(&self, other: &SingleVlanHeaderSlice<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for SingleVlanHeaderSlice<'a>
impl<'a> StructuralPartialEq for SingleVlanHeaderSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for SingleVlanHeaderSlice<'a>
impl<'a> RefUnwindSafe for SingleVlanHeaderSlice<'a>
impl<'a> Send for SingleVlanHeaderSlice<'a>
impl<'a> Sync for SingleVlanHeaderSlice<'a>
impl<'a> Unpin for SingleVlanHeaderSlice<'a>
impl<'a> UnwindSafe for SingleVlanHeaderSlice<'a>
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