Struct ndisapi_rs::EthRequest
source · #[repr(C)]pub struct EthRequest<'a> {
pub adapter_handle: HANDLE,
pub packet: EthPacket<'a>,
}
Expand description
This structure represents a request for an Ethernet packet, containing a network adapter handle and an EthPacket
.
A Rust equivalent for the _ETH_REQUEST structure.
adapter_handle
is a handle to the network adapter associated with this request. The packet
field is an EthPacket
that represents the Ethernet packet for this request.
Fields§
§adapter_handle: HANDLE
A handle to the network adapter associated with this request.
packet: EthPacket<'a>
An EthPacket
representing the Ethernet packet for this request.
Implementations§
source§impl<'a> EthRequest<'a>
impl<'a> EthRequest<'a>
Provides methods for manipulating the EthPacket
within an EthRequest
.
sourcepub fn take_packet(&mut self) -> Option<&'a mut IntermediateBuffer>
pub fn take_packet(&mut self) -> Option<&'a mut IntermediateBuffer>
Takes the EthPacket
out from the EthRequest
, replacing it with None
.
This is useful when you want to use the packet’s buffer elsewhere, while ensuring that the EthRequest
no longer has access to it.
sourcepub fn set_packet(&mut self, buffer: &'a mut IntermediateBuffer)
pub fn set_packet(&mut self, buffer: &'a mut IntermediateBuffer)
Sets the EthPacket
for the EthRequest
using a mutable reference to an IntermediateBuffer
.
This method allows you to associate a new buffer with the EthRequest
. This is useful when you have a buffer that you want to send with the EthRequest
.