Struct rpcap::write::PcapWriter
[−]
[src]
pub struct PcapWriter<W: Write> { /* fields omitted */ }
The PcapReader
struct allows reading packets from a packet capture.
Methods
impl<W: Write> PcapWriter<W>
[src]
fn new(writer: W, opts: WriteOptions) -> Result<Self, PcapError>
Create a new PcapWriter
that writes the packet capture data to the specified Write
.
fn append(writer: W, opts: WriteOptions) -> Result<Self, PcapError>
Create a new PcapWriter
that appends the packets to an existing Write
. If the
WriteOptions
specified here are different than those used to create the file, the
resulting file will be invalid.
fn write(&mut self, packet: &CapturedPacket) -> Result<(), PcapError>
Write a package to the capture file.
fn flush(&mut self) -> Result<(), Error>
Flushes the underlying writer.
fn take_writer(self) -> W
Destroys this PcapWriter
and returns access to the underlying Write
.