pub struct PcapStreamWriter<W: Write> { /* private fields */ }Expand description
PCAP writer for streaming writes.
Writes packets one at a time without buffering them all in memory.
Implementations§
Source§impl PcapStreamWriter<BufWriter<File>>
impl PcapStreamWriter<BufWriter<File>>
Source§impl<W: Write> PcapStreamWriter<W>
impl<W: Write> PcapStreamWriter<W>
Sourcepub fn from_writer(writer: W) -> Result<Self>
pub fn from_writer(writer: W) -> Result<Self>
Create a PcapStreamWriter from any writer.
Sourcepub fn write(&mut self, cap: &CapturedPacket) -> Result<()>
pub fn write(&mut self, cap: &CapturedPacket) -> Result<()>
Write a captured packet with metadata.
Sourcepub fn write_packet(&mut self, pkt: &Packet) -> Result<()>
pub fn write_packet(&mut self, pkt: &Packet) -> Result<()>
Write a plain packet (timestamp=0, orig_len=data length).
Auto Trait Implementations§
impl<W> Freeze for PcapStreamWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for PcapStreamWriter<W>where
W: RefUnwindSafe,
impl<W> Send for PcapStreamWriter<W>where
W: Send,
impl<W> Sync for PcapStreamWriter<W>where
W: Sync,
impl<W> Unpin for PcapStreamWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for PcapStreamWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for PcapStreamWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more