Struct smoltcp::phy::PcapWriter
source · pub struct PcapWriter<D, S>where
D: for<'a> Device<'a>,
S: PcapSink + Clone,{ /* private fields */ }
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 + Clone> PcapWriter<D, S>
impl<D: for<'a> Device<'a>, S: PcapSink + Clone> PcapWriter<D, S>
sourcepub fn new(
lower: D,
sink: S,
mode: PcapMode,
link_type: PcapLinkType
) -> PcapWriter<D, S>
pub fn new(
lower: D,
sink: S,
mode: PcapMode,
link_type: PcapLinkType
) -> PcapWriter<D, S>
Creates a packet capture writer.
Trait Implementations§
source§impl<D: Debug, S: Debug> Debug for PcapWriter<D, S>where
D: for<'a> Device<'a>,
S: PcapSink + Clone,
impl<D: Debug, S: Debug> Debug for PcapWriter<D, S>where
D: for<'a> Device<'a>,
S: PcapSink + Clone,
source§impl<'a, D, S> Device<'a> for PcapWriter<D, S>where
D: for<'b> Device<'b>,
S: PcapSink + Clone + 'a,
impl<'a, D, S> Device<'a> for PcapWriter<D, S>where
D: for<'b> Device<'b>,
S: PcapSink + Clone + 'a,
type RxToken = RxToken<<D as Device<'a>>::RxToken, S>
type TxToken = TxToken<<D as Device<'a>>::TxToken, S>
source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.