EthPacketMut

Struct EthPacketMut 

Source
#[repr(C)]
pub struct EthPacketMut<'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 optional 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. This structure is particularly useful when the packet data needs to be modified.

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> AsMut<Option<&'a mut IntermediateBuffer>> for EthPacketMut<'a>

Implements the AsMut trait for EthPacketMut.

This implementation facilitates the conversion of an EthPacketMut into a mutable reference to an Option<&'a mut IntermediateBuffer>. This conversion is useful when there is a need to directly manipulate the buffer of a packet. By implementing AsMut for EthPacketMut, we provide a convenient and idiomatic way to perform this transformation.

Source§

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

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'a> AsRef<Option<&'a mut IntermediateBuffer>> for EthPacketMut<'a>

Implements the AsRef trait for EthPacketMut.

This implementation facilitates the conversion of an EthPacketMut into a reference to an Option<&'a mut IntermediateBuffer>. This conversion is useful when there is a need to directly access the buffer of a packet. By implementing AsRef for EthPacketMut, we provide a convenient and idiomatic way to perform this transformation.

Source§

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

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Default for EthPacketMut<'a>

Implements the Default trait for EthPacketMut.

This implementation allows for the creation of an “empty” EthPacketMut, i.e., a packet without a buffer. This is useful when initializing a variable of type EthPacketMut without immediately associating a buffer with it.

Source§

fn default() -> Self

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

impl<'a> From<EthPacketMut<'a>> for Option<&'a mut IntermediateBuffer>

Implements the Into trait for EthPacketMut.

This implementation facilitates the conversion of an EthPacketMut into an Option<&'a mut IntermediateBuffer>. This conversion is useful when there is a need to directly manipulate the buffer of a packet. By implementing Into for EthPacketMut, we provide a convenient and idiomatic way to perform this transformation.

Source§

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

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for EthPacketMut<'a>

§

impl<'a> RefUnwindSafe for EthPacketMut<'a>

§

impl<'a> Send for EthPacketMut<'a>

§

impl<'a> Sync for EthPacketMut<'a>

§

impl<'a> Unpin for EthPacketMut<'a>

§

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