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>, ReadError>
pub fn from_slice(
slice: &'a [u8]
) -> Result<SingleVlanHeaderSlice<'a>, ReadError>
Creates a vlan header slice from a slice.
sourcepub fn priority_code_point(&self) -> u8
pub fn priority_code_point(&self) -> u8
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) -> u16
pub fn vlan_identifier(&self) -> u16
Reads the 12 bits “vland identifier” field from the slice.
sourcepub fn ether_type(&self) -> u16
pub fn ether_type(&self) -> u16
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 more