pub trait EthernetMethods: HeaderMetadata + BufferAccess {
    // Provided methods
    fn ethernet_destination(&self) -> MacAddress { ... }
    fn ethernet_source(&self) -> MacAddress { ... }
    fn ethernet_ether_type(&self) -> u16 { ... }
    fn ethernet_typed_ether_type(
        &self
    ) -> Result<EtherType, UnrecognizedEtherTypeError> { ... }
}
Expand description

Methods available for DataBuffer containing an Eth header.

Provided Methods§

source

fn ethernet_destination(&self) -> MacAddress

Returns the ethernet II destination.

source

fn ethernet_source(&self) -> MacAddress

Returns the ethernet II source.

source

fn ethernet_ether_type(&self) -> u16

Returns the ethernet II ether type.

source

fn ethernet_typed_ether_type( &self ) -> Result<EtherType, UnrecognizedEtherTypeError>

Returns the ethernet II ether type as EtherType.

§Errors

Returns an error if the ether type is not recognized.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B, HM> EthernetMethods for DataBuffer<B, HM>
where B: AsRef<[u8]>, HM: HeaderMetadata + HeaderMetadataMut + EthernetMarker,