Struct etherparse::SingleVlanSlice
source · 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 “vland 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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for SingleVlanSlice<'a>
impl<'a> Debug for SingleVlanSlice<'a>
source§impl<'a> PartialEq for SingleVlanSlice<'a>
impl<'a> PartialEq for SingleVlanSlice<'a>
impl<'a> Eq for SingleVlanSlice<'a>
impl<'a> StructuralPartialEq for SingleVlanSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for SingleVlanSlice<'a>
impl<'a> RefUnwindSafe for SingleVlanSlice<'a>
impl<'a> Send for SingleVlanSlice<'a>
impl<'a> Sync for SingleVlanSlice<'a>
impl<'a> Unpin for SingleVlanSlice<'a>
impl<'a> UnwindSafe for SingleVlanSlice<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)