Skip to main content

Capture

Trait Capture 

Source
pub trait Capture: Send + Sync {
    // Required method
    fn capture(&self, record: &CaptureRecord<'_>);

    // Provided method
    fn enabled(&self) -> bool { ... }
}
Expand description

Receives one record per forwarded request. The recorder a capture proxy provides: a queue writer implements this.

Implementations MUST NOT panic. capture is called inline after the response is produced, so heavy delivery (a network write) belongs behind a background queue; do the minimum here.

Required Methods§

Source

fn capture(&self, record: &CaptureRecord<'_>)

Records one exchange.

Provided Methods§

Source

fn enabled(&self) -> bool

Whether this capture will record. The handler checks it before assembling a record, so a disabled capture costs only this call.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§