Struct etherparse::SingleVlanHeaderSlice
source · [−]pub struct SingleVlanHeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing a single vlan header of a network package.
Implementations
sourceimpl<'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 slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the slice containing the single vlan header
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
sourceimpl<'a> Clone for SingleVlanHeaderSlice<'a>
impl<'a> Clone for SingleVlanHeaderSlice<'a>
sourcefn clone(&self) -> SingleVlanHeaderSlice<'a>
fn clone(&self) -> SingleVlanHeaderSlice<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for SingleVlanHeaderSlice<'a>
impl<'a> Debug for SingleVlanHeaderSlice<'a>
sourceimpl<'a> PartialEq<SingleVlanHeaderSlice<'a>> for SingleVlanHeaderSlice<'a>
impl<'a> PartialEq<SingleVlanHeaderSlice<'a>> for SingleVlanHeaderSlice<'a>
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &SingleVlanHeaderSlice<'a>) -> bool
fn ne(&self, other: &SingleVlanHeaderSlice<'a>) -> bool
This method tests for !=
.
impl<'a> Eq for SingleVlanHeaderSlice<'a>
impl<'a> StructuralEq for SingleVlanHeaderSlice<'a>
impl<'a> StructuralPartialEq for SingleVlanHeaderSlice<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more