Skip to main content

Module export

Module export 

Source
Expand description

Phase 5: Structured data export (JSON, Parquet, Avro).

Reads a PCAP file, applies optional filters, and writes each packet as a typed record to the requested format.

§Pipeline (7.3 channel-based)

  1. A producer thread streams packets from the PCAP file, applies structured + BPF filters, and sends PacketRecords through a bounded std::sync::mpsc::sync_channel.
  2. The main thread receives records and writes them to a format-specific PacketSink (JSON, Parquet, or Avro).

Decoupling I/O (producer) from serialisation (consumer) lets both stages run concurrently, improving throughput for CPU-bound formats.

Modules§

avro
Apache Avro writer for packet export.
json
JSONL (newline-delimited JSON) writer for packet export.
parquet
Apache Parquet columnar writer for packet export.

Structs§

ExportOptions
Options for export_file (single-output convenience wrapper).
ExportReport
Summary returned by export_file on success.
MultiExportOptions
Options for export_multi (fan-out to multiple simultaneous outputs).
MultiExportReport
Summary returned by export_multi on success.
OutputTarget
A single output target for fan-out export.
PacketRecord
A single packet record ready for serialisation.

Enums§

ExportFormat
Output format for packet export.

Traits§

PacketSink
Common interface for streaming packet writers.

Functions§

export_file
Export all packets from input to a single output (convenience wrapper around export_multi for backward compatibility).
export_multi
Export packets from input to one or more simultaneous outputs in a single streaming pass.