pub struct PcapNgStreamWriter<W: Write> { /* private fields */ }Expand description
PcapNG writer for streaming writes.
Writes packets one at a time. Auto-writes SHB + IDB on first packet.
Implementations§
Source§impl<W: Write> PcapNgStreamWriter<W>
impl<W: Write> PcapNgStreamWriter<W>
Sourcepub fn from_writer(writer: W) -> Result<Self>
pub fn from_writer(writer: W) -> Result<Self>
Create a PcapNgStreamWriter from any writer.
The SHB is written immediately. The IDB is written on the first packet.
Sourcepub fn write(&mut self, cap: &CapturedPacket) -> Result<()>
pub fn write(&mut self, cap: &CapturedPacket) -> Result<()>
Write a captured packet with metadata as an Enhanced Packet Block.
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 PcapNgStreamWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for PcapNgStreamWriter<W>where
W: RefUnwindSafe,
impl<W> Send for PcapNgStreamWriter<W>where
W: Send,
impl<W> Sync for PcapNgStreamWriter<W>where
W: Sync,
impl<W> Unpin for PcapNgStreamWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for PcapNgStreamWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for PcapNgStreamWriter<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more