pub struct EthernetPacket {
pub destination: MacAddr,
pub source: MacAddr,
pub ethertype: EtherType,
pub payload: Vec<u8>,
}
Expand description
Represents an Ethernet packet.
Fields§
§destination: MacAddr
Destination MAC address
source: MacAddr
Source MAC address
ethertype: EtherType
EtherType
payload: Vec<u8>
Payload. Next level protocol packet.
Implementations§
Source§impl EthernetPacket
impl EthernetPacket
Sourcepub fn from_bytes(packet: &[u8]) -> EthernetPacket
pub fn from_bytes(packet: &[u8]) -> EthernetPacket
Constructs a new EthernetPacket from bytes
Trait Implementations§
Source§impl Clone for EthernetPacket
impl Clone for EthernetPacket
Source§fn clone(&self) -> EthernetPacket
fn clone(&self) -> EthernetPacket
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 moreAuto Trait Implementations§
impl Freeze for EthernetPacket
impl RefUnwindSafe for EthernetPacket
impl Send for EthernetPacket
impl Sync for EthernetPacket
impl Unpin for EthernetPacket
impl UnwindSafe for EthernetPacket
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