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>

Provides methods for manipulating the EthPacket within an EthRequest.

source

pub fn new(adapter_handle: HANDLE) -> Self

Creates a new EthRequest with the specified adapter handle and an empty EthPacket.

Arguments
  • adapter_handle - A handle to the network adapter to be associated with this request.
Returns
  • A new EthRequest instance with the specified adapter handle and an empty EthPacket.
source

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.

source

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.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for EthRequest<'a>

§

impl<'a> !Send for EthRequest<'a>

§

impl<'a> !Sync for EthRequest<'a>

§

impl<'a> Unpin for EthRequest<'a>

§

impl<'a> !UnwindSafe for EthRequest<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.