Struct smoltcp::phy::PcapWriter
source · Expand description
A packet capture writer device.
Every packet transmitted or received through this device is timestamped and written (in the libpcap format) using the provided sink. Note that writes are fine-grained, and buffering is recommended.
The packet sink should be cheaply cloneable, as it is cloned on every
transmitted packet. For example, &'a mut Vec<u8>
is cheaply cloneable
but &std::io::File
Implementations§
source§impl<D: for<'a> Device<'a>, S: PcapSink> PcapWriter<D, S>
impl<D: for<'a> Device<'a>, S: PcapSink> PcapWriter<D, S>
sourcepub fn new(lower: D, sink: S, mode: PcapMode) -> PcapWriter<D, S>
pub fn new(lower: D, sink: S, mode: PcapMode) -> PcapWriter<D, S>
Creates a packet capture writer.
Trait Implementations§
source§impl<'a, D, S> Device<'a> for PcapWriter<D, S>where
D: for<'b> Device<'b>,
S: PcapSink + 'a,
impl<'a, D, S> Device<'a> for PcapWriter<D, S>where
D: for<'b> Device<'b>,
S: PcapSink + 'a,
type RxToken = RxToken<'a, <D as Device<'a>>::RxToken, S>
type TxToken = TxToken<'a, <D as Device<'a>>::TxToken, S>
source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.