Struct cross_socket::packet::ethernet::EthernetPacket
source · 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 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 moreAuto Trait Implementations§
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