Struct smoltcp::phy::FaultInjector [] [src]

pub struct FaultInjector<T: Device> { /* fields omitted */ }

A fault injector device.

A fault injector is a device that randomly drops or corrupts packets traversing it, according to preset probabilities.

Methods

impl<T: Device> FaultInjector<T>
[src]

Create a tracer device, using the given random number generator seed.

Return the underlying device, consuming the tracer.

Return the probability of corrupting a packet, in percents.

Return the probability of dropping a packet, in percents.

Set the probability of corrupting a packet, in percents.

Panics

This function panics if the probability is not between 0% and 100%.

Set the probability of dropping a packet, in percents.

Panics

This function panics if the probability is not between 0% and 100%.

Trait Implementations

impl<T: Debug + Device> Debug for FaultInjector<T>
[src]

Formats the value using the given formatter.

impl<T: Device> Device for FaultInjector<T> where
    T::RxBuffer: AsMut<[u8]>, 
[src]

Get maximum transmission unit. Read more

Receive a frame. Read more

Transmit a frame. Read more