smoltcp::phy

Struct 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,

Source§

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

Source§

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

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> Freeze for FuzzInjector<D, FTx, FRx>
where D: Freeze, FTx: Freeze, FRx: Freeze,

§

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

§

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

§

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

§

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

§

impl<D, FTx, FRx> UnwindSafe for FuzzInjector<D, FTx, FRx>
where D: UnwindSafe, FTx: UnwindSafe, FRx: 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> 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, 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.