Struct smoltcp::phy::FuzzInjector

source ·
pub struct FuzzInjector<D: Device, FTx: Fuzzer, FRx: Fuzzer> { /* private fields */ }
Expand description

A fuzz injector device.

A fuzz injector is a device that alters packets traversing through it according to the directions of a guided fuzzer. It is designed to support fuzzing internal state machines inside smoltcp, and is not for production use.

Implementations§

source§

impl<D: Device, FTx: Fuzzer, FRx: Fuzzer> FuzzInjector<D, FTx, FRx>

source

pub fn new(inner: D, fuzz_tx: FTx, fuzz_rx: FRx) -> FuzzInjector<D, FTx, FRx>

Create a fuzz injector device.

source

pub fn into_inner(self) -> D

Return the underlying device, consuming the fuzz injector.

Trait Implementations§

source§

impl<D: Debug + Device, FTx: Debug + Fuzzer, FRx: Debug + Fuzzer> Debug for FuzzInjector<D, FTx, FRx>

source§

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

Formats the value using the given formatter. Read more
source§

impl<D: Device, FTx, FRx> Device for FuzzInjector<D, FTx, FRx>where
FTx: Fuzzer,
FRx: Fuzzer,

§

type RxToken<'a>
where
Self: 'a
= RxToken<'a, <D as Device>::RxToken<'a>, FRx>

§

type TxToken<'a>
where
Self: 'a
= TxToken<'a, <D as Device>::TxToken<'a>, FTx>

source§

fn capabilities(&self) -> DeviceCapabilities

Get a description of device capabilities.
source§

fn receive(
&mut self,
timestamp: Instant
) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>

Construct a token pair consisting of one receive token and one transmit token. Read more
source§

fn transmit(&mut self, timestamp: Instant) -> Option<Self::TxToken<'_>>

Construct a transmit token. Read more

Auto Trait Implementations§

§

impl<D, FTx, FRx> RefUnwindSafe for FuzzInjector<D, FTx, FRx>where
D: RefUnwindSafe,
FRx: RefUnwindSafe,
FTx: RefUnwindSafe,

§

impl<D, FTx, FRx> Send for FuzzInjector<D, FTx, FRx>where
D: Send,
FRx: Send,
FTx: Send,

§

impl<D, FTx, FRx> Sync for FuzzInjector<D, FTx, FRx>where
D: Sync,
FRx: Sync,
FTx: Sync,

§

impl<D, FTx, FRx> Unpin for FuzzInjector<D, FTx, FRx>where
D: Unpin,
FRx: Unpin,
FTx: Unpin,

§

impl<D, FTx, FRx> UnwindSafe for FuzzInjector<D, FTx, FRx>where
D: UnwindSafe,
FRx: UnwindSafe,
FTx: UnwindSafe,

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.