[][src]Struct netproto::frames::EthernetFrame

pub struct EthernetFrame<'p> {
    pub dst_mac: MacAddress,
    pub src_mac: MacAddress,
    pub eth_type: EtherType,
    pub payload: &'p [u8],
}

Fields

dst_mac: MacAddresssrc_mac: MacAddresseth_type: EtherTypepayload: &'p [u8]

Methods

impl<'p> EthernetFrame<'p>[src]

pub fn new(bytes: &[u8]) -> EthernetFrame[src]

Produces a new EthernetFrame

pub fn as_string(&self) -> String[src]

Returns the string representation of an EthernetFrame

pub fn eth_type(&self) -> &EtherType[src]

Returns the EtherType contained in an EthernetFrame

pub fn payload(&self) -> &[u8][src]

Returns the payload contained in an EthernetFrame

Auto Trait Implementations

impl<'p> Send for EthernetFrame<'p>

impl<'p> Sync for EthernetFrame<'p>

Blanket Implementations

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

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

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]