Enum kvarn::application::PushedResponsePipe
source · pub enum PushedResponsePipe {
Http2(SendPushedResponse<Bytes>),
}
Expand description
A ResponsePipe
-like for a pushed request-response pair.
The only logic difference between this and ResponsePipe
is the
lack of a push_request
method. If you want to push more than one request,
use the same method on ResponsePipe
more times.
Variants§
Http2(SendPushedResponse<Bytes>)
Available on crate feature
http2
only.A HTTP/2 pushed response pipe.
This is the only variant for now, but as HTTP/3
is implemented, a Http3
variant will be added.
Implementations§
source§impl PushedResponsePipe
impl PushedResponsePipe
sourcepub fn send_response(
self,
response: Response<()>,
end_of_stream: bool
) -> Result<ResponseBodyPipe, Error>
pub fn send_response( self, response: Response<()>, end_of_stream: bool ) -> Result<ResponseBodyPipe, Error>
Sends a single push response.
Errors
Errors are passed from the HTTP libraries, for now only h2
.
See h2::server::SendPushedResponse::send_response()
for more information.
sourcepub fn ensure_version<T>(&self, response: &mut Response<T>)
pub fn ensure_version<T>(&self, response: &mut Response<T>)
Ensures the version of response
depending on inner version if PushedResponsePipe
.