Skip to main content

CaptureObserver

Trait CaptureObserver 

Source
pub trait CaptureObserver: Send + Sync {
    // Required method
    fn record(&self, event: CaptureEvent<'_>);

    // Provided methods
    fn record_request(&self, info: UpstreamRequest<'_>, body: &Bytes) { ... }
    fn logs_responses(&self) -> bool { ... }
}

Required Methods§

Source

fn record(&self, event: CaptureEvent<'_>)

Provided Methods§

Source

fn record_request(&self, info: UpstreamRequest<'_>, body: &Bytes)

CaptureEvent::Request for a body the caller already holds as Bytes: an observer that keeps the body may keep this handle instead of a copy of it.

Source

fn logs_responses(&self) -> bool

Whether response events are kept right now (Go’s requestLogCaptureEnabled). An observer that drops them while logging is off says so, so executors need not buffer data that exists only to be logged.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§