[][src]Struct smoltcp::phy::Tracer

pub struct Tracer<D: for<'a> Device<'a>, P: PrettyPrint> { /* fields omitted */ }

A tracer device.

A tracer is a device that pretty prints all packets traversing it using the provided writer function, and then passes them to another device.

Implementations

impl<D: for<'a> Device<'a>, P: PrettyPrint> Tracer<D, P>[src]

pub fn new(
    inner: D,
    writer: fn(timestamp: Instant, printer: PrettyPrinter<'_, P>)
) -> Tracer<D, P>
[src]

Create a tracer device.

pub fn get_ref(&self) -> &D[src]

Get a reference to the underlying device.

Even if the device offers reading through a standard reference, it is inadvisable to directly read from the device as doing so will circumvent the tracing.

pub fn get_mut(&mut self) -> &mut D[src]

Get a mutable reference to the underlying device.

It is inadvisable to directly read from the device as doing so will circumvent the tracing.

pub fn into_inner(self) -> D[src]

Return the underlying device, consuming the tracer.

Trait Implementations

impl<'a, D, P> Device<'a> for Tracer<D, P> where
    D: for<'b> Device<'b>,
    P: PrettyPrint + 'a, 
[src]

type RxToken = RxToken<<D as Device<'a>>::RxToken, P>

type TxToken = TxToken<<D as Device<'a>>::TxToken, P>

Auto Trait Implementations

impl<D, P> RefUnwindSafe for Tracer<D, P> where
    D: RefUnwindSafe
[src]

impl<D, P> Send for Tracer<D, P> where
    D: Send
[src]

impl<D, P> Sync for Tracer<D, P> where
    D: Sync
[src]

impl<D, P> Unpin for Tracer<D, P> where
    D: Unpin
[src]

impl<D, P> UnwindSafe for Tracer<D, P> where
    D: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.