pub enum ResponsePipe {
    Http1(Arc<Mutex<Encryption>>),
    Http2(SendResponse<Bytes>),
}
Expand description

A pipe to send a Response through.

You may also push requests if the pipe is ResponsePipe::Http2 by calling ResponsePipe::push_request.

Variants§

§

Http1(Arc<Mutex<Encryption>>)

A HTTP/1 stream to send a response.

§

Http2(SendResponse<Bytes>)

Available on crate feature http2 only.

A HTTP/2 response pipe.

Implementations§

You must ensure the Response::version() is correct before calling this function. It can be guaranteed by first calling Self::ensure_version_and_length().

It is critical to ResponseBodyPipe::close(), else the message won’t be seen as fully transmitted.

Errors

Passes any errors from writing to the stream. see AsyncWriteExt::write() and h2::server::SendResponse::send_response() for more info.

Pushes request to client.

Errors

If you try to push if self is ResponsePipe::Http1, an Error::PushOnHttp1 is returned. Returns errors from h2::server::SendResponse::push_request().

Ensures the version and length of the response using the variant of ResponsePipe.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more