pub struct PcapWriter<D, S>{ /* 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: Device, S: PcapSink> PcapWriter<D, S>
impl<D: Device, 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<D, S> Debug for PcapWriter<D, S>
impl<D, S> Debug for PcapWriter<D, S>
Source§impl<D: Device, S> Device for PcapWriter<D, S>where
S: PcapSink,
impl<D: Device, S> Device for PcapWriter<D, S>where
S: PcapSink,
type RxToken<'a> = RxToken<'a, <D as Device>::RxToken<'a>, S> where Self: 'a
type TxToken<'a> = TxToken<'a, <D as Device>::TxToken<'a>, S> where Self: 'a
Source§fn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.