Skip to main content

MakeBodyCaptureSink

Trait MakeBodyCaptureSink 

pub trait MakeBodyCaptureSink:
    Send
    + Sync
    + 'static {
    type Sink: BodyCaptureSink;

    // Required method
    fn make_sink(
        &self,
        head: CapturedHead,
    ) -> impl Future<Output = Option<Self::Sink>> + Send;
}
Available on crate features http and std only.
Expand description

Creates a dedicated streaming capture sink for an HTTP message.

Returning None skips body capture for that message. The factory future is awaited after the HTTP head is available and before its body starts flowing.

Required Associated Types§

type Sink: BodyCaptureSink

The per-message capture sink.

Required Methods§

fn make_sink( &self, head: CapturedHead, ) -> impl Future<Output = Option<Self::Sink>> + Send

Create a capture sink from the request or response head.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl<F, Fut, S> MakeBodyCaptureSink for F
where F: Fn(CapturedHead) -> Fut + Send + Sync + 'static, Fut: Future<Output = Option<S>> + Send + 'static, S: BodyCaptureSink,

§

type Sink = S