pub struct EthernetHeader {
pub destination: MacAddr,
pub source: MacAddr,
pub ethertype: EtherType,
}
Expand description
Represents the Ethernet Header.
Fields§
§destination: MacAddr
Destination MAC address
source: MacAddr
Source MAC address
ethertype: EtherType
EtherType
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 duplicate 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
impl Eq for EthernetHeader
impl StructuralPartialEq for EthernetHeader
Auto Trait Implementations§
impl Freeze for EthernetHeader
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