#[repr(C)]pub struct EthPacket<'a> {
pub buffer: Option<&'a IntermediateBuffer>,
}
Expand description
This structure represents an Ethernet packet with an optional reference to an IntermediateBuffer
.
A Rust equivalent for the _NDISRD_ETH_Packet structure.
The buffer
field is an optional reference to an IntermediateBuffer
. This design allows for flexibility
when manipulating Ethernet packets, as a packet may not always have a buffer associated with it.
This structure is particularly useful when the packet data needs to be read but not modified.
Fields§
§buffer: Option<&'a IntermediateBuffer>
An optional reference to an IntermediateBuffer
representing the buffer for this Ethernet packet.
Trait Implementations§
Source§impl<'a> AsRef<Option<&'a IntermediateBuffer>> for EthPacket<'a>
Implements the AsRef
trait for EthPacket
.
impl<'a> AsRef<Option<&'a IntermediateBuffer>> for EthPacket<'a>
Implements the AsRef
trait for EthPacket
.
This implementation facilitates the conversion of an EthPacket
into a reference to an Option<&'a IntermediateBuffer>
.
This conversion is useful when there is a need to directly access the buffer of a packet. By implementing AsRef
for EthPacket
,
we provide a convenient and idiomatic way to perform this transformation.
Source§fn as_ref(&self) -> &Option<&'a IntermediateBuffer>
fn as_ref(&self) -> &Option<&'a IntermediateBuffer>
Source§impl<'a> Default for EthPacket<'a>
Implements the Default
trait for EthPacket
.
impl<'a> Default for EthPacket<'a>
Implements the Default
trait for EthPacket
.
This implementation allows for the creation of an “empty” EthPacket
, i.e., a packet without a buffer. This is useful when
initializing a variable of type EthPacket
without immediately associating a buffer with it.
Source§impl<'a> From<EthPacket<'a>> for Option<&'a IntermediateBuffer>
Implements the Into
trait for EthPacket
.
impl<'a> From<EthPacket<'a>> for Option<&'a IntermediateBuffer>
Implements the Into
trait for EthPacket
.
This implementation facilitates the conversion of an EthPacket
into an Option<&'a IntermediateBuffer>
.
This conversion is useful when there is a need to directly manipulate the buffer of a packet. By implementing Into
for EthPacket
,
we provide a convenient and idiomatic way to perform this transformation.