Skip to main content

RequestWriter

Trait RequestWriter 

pub trait RequestWriter:
    Send
    + Sync
    + 'static {
    // Required method
    fn write_request(&self, req: Request) -> impl Future<Output = ()> + Send;
}
Available on crate features http and std only.
Expand description

A trait for writing http requests.

Required Methods§

fn write_request(&self, req: Request) -> impl Future<Output = ()> + Send

Write the HTTP request while its body is streaming.

Implementations must consume or deliberately drop the body while this future runs. Retaining it for later applies backpressure once its single-frame observational capture queue is full.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl RequestWriter for Sender<Request>

§

async fn write_request(&self, req: Request)

§

impl RequestWriter for UnboundedSender<Request>

§

async fn write_request(&self, req: Request)

Implementors§

§

impl RequestWriter for BidirectionalWriter<Sender<BidirectionalMessage>>

§

impl RequestWriter for BidirectionalWriter<UnboundedSender<BidirectionalMessage>>

§

impl RequestWriter for PerMessageFileWriter

§

impl<F, Fut> RequestWriter for F
where F: Fn(Request) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,