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§
fn record(&self, event: CaptureEvent<'_>)
Provided Methods§
Sourcefn record_request(&self, info: UpstreamRequest<'_>, body: &Bytes)
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.
Sourcefn logs_responses(&self) -> bool
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".