pub trait DataEvent {
// Required methods
fn payload(&self) -> &[u8] ⓘ;
fn timestamp_ns(&self) -> u64;
fn direction(&self) -> Direction;
fn connection_id(&self) -> u64;
fn process_id(&self) -> u32;
fn remote_port(&self) -> u16;
// Provided method
fn into_payload(self) -> Bytes
where Self: Sized { ... }
}Expand description
Trait for data events that can be collated into HTTP exchanges.
Implement this trait for your data source (e.g., eBPF events, pcap packets) to enable HTTP collation.
Required Methods§
Sourcefn timestamp_ns(&self) -> u64
fn timestamp_ns(&self) -> u64
Timestamp in nanoseconds (monotonic, for latency calculation)
Sourcefn connection_id(&self) -> u64
fn connection_id(&self) -> u64
Connection identifier (0 if unavailable, falls back to process_id)
Sourcefn process_id(&self) -> u32
fn process_id(&self) -> u32
Process ID for connection tracking
Sourcefn remote_port(&self) -> u16
fn remote_port(&self) -> u16
Remote port (0 if unknown)
Provided Methods§
Sourcefn into_payload(self) -> Byteswhere
Self: Sized,
fn into_payload(self) -> Byteswhere
Self: Sized,
Consume self and return the payload as Bytes.
The default implementation copies via payload().to_vec(). Implementors
that already own a Bytes (or Vec<u8>) should override this to avoid
the copy.