pub struct SingleVlanSlice<'a> { /* private fields */ }
Expand description
Slice containing a VLAN header & payload.
Implementations§
Source§impl<'a> SingleVlanSlice<'a>
impl<'a> SingleVlanSlice<'a>
Sourcepub fn from_slice(slice: &'a [u8]) -> Result<SingleVlanSlice<'a>, LenError>
pub fn from_slice(slice: &'a [u8]) -> Result<SingleVlanSlice<'a>, LenError>
Try creating a SingleVlanSlice
from a slice containing the
VLAN header & payload.
Sourcepub fn priority_code_point(&self) -> VlanPcp
pub fn priority_code_point(&self) -> VlanPcp
Read the “priority_code_point” field of the VLAN header.
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 of the VLAN header.
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 “vlan identifier” field from the VLAN header.
Sourcepub fn ether_type(&self) -> EtherType
pub fn ether_type(&self) -> EtherType
Read the “Tag protocol identifier” field from the VLAN header.
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
Sourcepub fn header_slice(&self) -> &[u8] ⓘ
pub fn header_slice(&self) -> &[u8] ⓘ
Slice containing the Ethernet 2 header.
Sourcepub fn payload(&self) -> EtherPayloadSlice<'a>
pub fn payload(&self) -> EtherPayloadSlice<'a>
Returns the slice containing the VLAN payload & ether type identifying it’s content type.
Sourcepub fn payload_slice(&self) -> &'a [u8] ⓘ
pub fn payload_slice(&self) -> &'a [u8] ⓘ
Returns the slice containing the VLAN payload.
Sourcepub const fn header_len(&self) -> usize
pub const fn header_len(&self) -> usize
Length of the VLAN header in bytes (equal to
crate::SingleVlanHeader::LEN
).
Trait Implementations§
Source§impl<'a> Clone for SingleVlanSlice<'a>
impl<'a> Clone for SingleVlanSlice<'a>
Source§fn clone(&self) -> SingleVlanSlice<'a>
fn clone(&self) -> SingleVlanSlice<'a>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more