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 [mod@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
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PushedResponsePipe
impl RefUnwindSafe for PushedResponsePipe
impl Send for PushedResponsePipe
impl Sync for PushedResponsePipe
impl Unpin for PushedResponsePipe
impl UnwindSafe for PushedResponsePipe
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