pub struct RequestLog(/* private fields */);Expand description
Cloneable per-request sink carried in HTTP extensions. Capture helpers must mask upstream credentials before passing preformatted API sections, as in Go.
Implementations§
Source§impl RequestLog
impl RequestLog
Sourcepub fn capture_sink(&self) -> CaptureSink
pub fn capture_sink(&self) -> CaptureSink
Executors receive this through ExecRequest::capture(); WebSocket owners can retain it across connection tasks, independently of task-local state.
Sourcepub fn request_id(&self) -> String
pub fn request_id(&self) -> String
Full middleware UUID (the filename uses its trailing eight characters).
Sourcepub fn detach_websocket(&self) -> Option<WebsocketLog>
pub fn detach_websocket(&self) -> Option<WebsocketLog>
Transfer finalization to the connection task before returning HTTP 101. Returns None for disabled logging, a second detach, or an already finalized request. This keeps disabled websocket logging free of disk/body capture.
Sourcepub fn redact_sdp(&self)
pub fn redact_sdp(&self)
Logs this request’s bodies, downstream and upstream, without SDP ICE credentials
(cpa_exec::codex_live::redact_sdp). The bytes on the wire are unchanged.
pub fn api_request(&self, bytes: &[u8])
pub fn api_response(&self, bytes: &[u8], timestamp: DateTime<Local>)
pub fn api_websocket_timeline(&self, bytes: &[u8])
Trait Implementations§
Source§impl CaptureObserver for RequestLog
impl CaptureObserver for RequestLog
Source§fn 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.fn record(&self, event: CaptureEvent<'_>)
Source§fn 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.Auto Trait Implementations§
impl Forget for RequestLog
impl Freeze for RequestLog
impl Move for RequestLog
impl RefUnwindSafe for RequestLog
impl Send for RequestLog
impl Sync for RequestLog
impl Unpin for RequestLog
impl UnsafeUnpin for RequestLog
impl UnwindSafe for RequestLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more