EthRequestMut

Struct EthRequestMut 

Source
#[repr(C)]
pub struct EthRequestMut<'a> { pub adapter_handle: HANDLE, pub packet: EthPacketMut<'a>, }
Expand description

This structure represents a request for an Ethernet packet, containing a network adapter handle and an EthPacketMut.

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 EthPacketMut that represents the Ethernet packet for this request.

Fields§

§adapter_handle: HANDLE

A handle to the network adapter associated with this request.

§packet: EthPacketMut<'a>

An EthPacketMut representing the Ethernet packet for this request.

Implementations§

Source§

impl<'a> EthRequestMut<'a>

Provides methods for manipulating the EthPacketMut within an EthRequestMut.

Source

pub fn new(adapter_handle: HANDLE) -> Self

Creates a new EthRequestMut with the specified adapter handle and an empty EthPacketMut.

§Arguments
  • adapter_handle - A handle to the network adapter to be associated with this request.
§Returns
  • A new EthRequestMut instance with the specified adapter handle and an empty EthPacketMut.
Source

pub fn take_packet(&mut self) -> Option<&'a mut IntermediateBuffer>

Takes the EthPacketMut out from the EthRequestMut, replacing it with None.

This is useful when you want to use the packet’s buffer elsewhere, while ensuring that the EthRequestMut no longer has access to it.

Source

pub fn set_packet(&mut self, buffer: &'a mut IntermediateBuffer)

Sets the EthPacketMut for the EthRequestMut using a mutable reference to an IntermediateBuffer.

This method allows you to associate a new buffer with the EthRequestMut. This is useful when you have a buffer that you want to send with the EthRequestMut.

Auto Trait Implementations§

§

impl<'a> Freeze for EthRequestMut<'a>

§

impl<'a> RefUnwindSafe for EthRequestMut<'a>

§

impl<'a> Send for EthRequestMut<'a>

§

impl<'a> Sync for EthRequestMut<'a>

§

impl<'a> Unpin for EthRequestMut<'a>

§

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

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.