[][src]Struct etherparse::SingleVlanHeader

pub struct SingleVlanHeader {
    pub priority_code_point: u8,
    pub drop_eligible_indicator: bool,
    pub vlan_identifier: u16,
    pub ether_type: u16,
}

IEEE 802.1Q VLAN Tagging Header

Fields

priority_code_point: u8

A 3 bit number which refers to the IEEE 802.1p class of service and maps to the frame priority level.

drop_eligible_indicator: bool

Indicate that the frame may be dropped under the presence of congestion.

vlan_identifier: u16

12 bits vland identifier.

ether_type: u16

"Tag protocol identifier": Type id of content after this header. Refer to the "EtherType" for a list of possible supported values.

Methods

impl SingleVlanHeader[src]

pub fn read_from_slice(
    slice: &[u8]
) -> Result<(SingleVlanHeader, &[u8]), ReadError>
[src]

Read an SingleVlanHeader from a slice and return the header & unused parts of the slice.

pub fn read<T: Read + Seek + Sized>(
    reader: &mut T
) -> Result<SingleVlanHeader, Error>
[src]

Read a IEEE 802.1Q VLAN tagging header

pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), WriteError>[src]

Write the IEEE 802.1Q VLAN tagging header

Trait Implementations

impl SerializedSize for SingleVlanHeader[src]

const SERIALIZED_SIZE: usize[src]

Serialized size of the header in bytes.

impl Default for SingleVlanHeader[src]

impl Clone for SingleVlanHeader[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Eq for SingleVlanHeader[src]

impl PartialEq<SingleVlanHeader> for SingleVlanHeader[src]

impl Debug for SingleVlanHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]