pub struct Tracer<D: for<'a> Device<'a>, P: PrettyPrint> { /* private fields */ }
Expand description
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§
source§impl<D: for<'a> Device<'a>, P: PrettyPrint> Tracer<D, P>
impl<D: for<'a> Device<'a>, P: PrettyPrint> Tracer<D, P>
sourcepub fn new(
inner: D,
writer: fn(timestamp: Instant, printer: PrettyPrinter<'_, P>)
) -> Tracer<D, P>
pub fn new(
inner: D,
writer: fn(timestamp: Instant, printer: PrettyPrinter<'_, P>)
) -> Tracer<D, P>
Create a tracer device.
sourcepub fn into_inner(self) -> D
pub fn into_inner(self) -> D
Return the underlying device, consuming the tracer.
Trait Implementations§
source§impl<'a, D, P> Device<'a> for Tracer<D, P>where
D: for<'b> Device<'b>,
P: PrettyPrint + 'a,
impl<'a, D, P> Device<'a> for Tracer<D, P>where
D: for<'b> Device<'b>,
P: PrettyPrint + 'a,
type RxToken = RxToken<<D as Device<'a>>::RxToken, P>
type TxToken = TxToken<<D as Device<'a>>::TxToken, P>
source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.