Struct ndisapi_rs::EthPacket
source · #[repr(C)]pub struct EthPacket<'a> {
pub buffer: Option<&'a mut IntermediateBuffer>,
}
Expand description
This structure represents an Ethernet packet with an optional mutable reference to an IntermediateBuffer
.
A Rust equivalent for the _NDISRD_ETH_Packet structure.
The buffer
field is an Option wrapping a mutable 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 (i.e., the buffer may be None
).
Fields§
§buffer: Option<&'a mut IntermediateBuffer>
An optional mutable reference to an IntermediateBuffer
representing the buffer for this Ethernet packet.
Trait Implementations§
source§impl<'a> Default for EthPacket<'a>
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 mut IntermediateBuffer>
impl<'a> From<EthPacket<'a>> for Option<&'a mut IntermediateBuffer>
Implements the Into
trait for EthPacket
.
The purpose of this implementation is to facilitate the conversion of an EthPacket
into an Option<&'a mut IntermediateBuffer>
.
The conversion is valuable 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.