Struct xenet_packet::ethernet::EthernetHeader
source · pub struct EthernetHeader {
pub destination: MacAddr,
pub source: MacAddr,
pub ethertype: EtherType,
}Expand description
Represents the Ethernet Header.
Fields§
§destination: MacAddrDestination MAC address
source: MacAddrSource MAC address
ethertype: EtherTypeEtherType
Implementations§
source§impl EthernetHeader
impl EthernetHeader
sourcepub fn from_bytes(packet: &[u8]) -> Result<EthernetHeader, String>
pub fn from_bytes(packet: &[u8]) -> Result<EthernetHeader, String>
Construct an Ethernet header from a byte slice.
Trait Implementations§
source§impl Clone for EthernetHeader
impl Clone for EthernetHeader
source§fn clone(&self) -> EthernetHeader
fn clone(&self) -> EthernetHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for EthernetHeader
impl Debug for EthernetHeader
source§impl PartialEq for EthernetHeader
impl PartialEq for EthernetHeader
source§fn eq(&self, other: &EthernetHeader) -> bool
fn eq(&self, other: &EthernetHeader) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for EthernetHeader
impl StructuralEq for EthernetHeader
impl StructuralPartialEq for EthernetHeader
Auto Trait Implementations§
impl RefUnwindSafe for EthernetHeader
impl Send for EthernetHeader
impl Sync for EthernetHeader
impl Unpin for EthernetHeader
impl UnwindSafe for EthernetHeader
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
Mutably borrows from an owned value. Read more