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
sourceimpl<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
sourceimpl<'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>
sourcefn capabilities(&self) -> DeviceCapabilities
fn capabilities(&self) -> DeviceCapabilities
Get a description of device capabilities.
Auto Trait Implementations
impl<D, S> !RefUnwindSafe for PcapWriter<D, S>
impl<D, S> Send for PcapWriter<D, S> where
D: Send,
S: Send,
impl<D, S> !Sync for PcapWriter<D, S>
impl<D, S> Unpin for PcapWriter<D, S> where
D: Unpin,
S: Unpin,
impl<D, S> UnwindSafe for PcapWriter<D, S> where
D: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more