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>

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§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

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.

source§

fn from(val: EthPacket<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for EthPacket<'a>

§

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

§

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

§

impl<'a> Unpin for EthPacket<'a>

§

impl<'a> !UnwindSafe for EthPacket<'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.