WinDivertPacket

Struct WinDivertPacket 

Source
pub struct WinDivertPacket<'a, L: WinDivertLayerTrait> {
    pub address: WinDivertAddress<L>,
    pub data: Cow<'a, [u8]>,
}
Expand description

Raw captured packet

Fields§

§address: WinDivertAddress<L>

Address data

§data: Cow<'a, [u8]>

Raw captured data

Implementations§

Source§

impl<'a> WinDivertPacket<'a, NetworkLayer>

Source

pub unsafe fn new(data: Vec<u8>) -> Self

Create a new network packet from a raw buffer

§Safety

address is zeroed, user must fill it with correct data before sending.

Source

pub fn recalculate_checksums( &mut self, flags: ChecksumFlags, ) -> Result<(), WinDivertError>

Recalculate the checksums of the packet This is a noop if the packet is not owned.

Source§

impl<'a> WinDivertPacket<'a, ForwardLayer>

Source

pub unsafe fn new(data: Vec<u8>) -> Self

Create a new network forward packet from a raw buffer

§Safety

address is zeroed, user must fill it with correct data before sending.

Source

pub fn recalculate_checksums( &mut self, flags: ChecksumFlags, ) -> Result<(), WinDivertError>

Recalculate the checksums of the packet This is a noop if the packet is not owned.

Source§

impl<'a, L: WinDivertLayerTrait> WinDivertPacket<'a, L>

Source

pub fn into_owned(self) -> WinDivertPacket<'static, L>

Create an owned packet from a borrowed packet

Trait Implementations§

Source§

impl<'a, L: Clone + WinDivertLayerTrait> Clone for WinDivertPacket<'a, L>

Source§

fn clone(&self) -> WinDivertPacket<'a, L>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, L: Debug + WinDivertLayerTrait> Debug for WinDivertPacket<'a, L>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, L> Freeze for WinDivertPacket<'a, L>

§

impl<'a, L> RefUnwindSafe for WinDivertPacket<'a, L>
where L: RefUnwindSafe,

§

impl<'a, L> Send for WinDivertPacket<'a, L>
where L: Send,

§

impl<'a, L> Sync for WinDivertPacket<'a, L>
where L: Sync,

§

impl<'a, L> Unpin for WinDivertPacket<'a, L>
where L: Unpin,

§

impl<'a, L> UnwindSafe for WinDivertPacket<'a, L>
where L: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.