pub struct OutgoingResponse<B = Body> { /* private fields */ }
Available on crate feature
server
only.Expand description
Server response that can be sent to an HTTP client.
Implementations§
Source§impl OutgoingResponse<()>
impl OutgoingResponse<()>
Sourcepub const fn builder() -> OutgoingResponseBuilder
pub const fn builder() -> OutgoingResponseBuilder
Get a builder for the outgoing response.
Source§impl<B> OutgoingResponse<B>
impl<B> OutgoingResponse<B>
Sourcepub fn deconstruct(self) -> (ResponseHeader, B, Option<UpgradeRequest>)
pub fn deconstruct(self) -> (ResponseHeader, B, Option<UpgradeRequest>)
Deconstruct the response back into its response header and body.
Sourcepub fn into_builder(self) -> (OutgoingResponseBuilder, B)
pub fn into_builder(self) -> (OutgoingResponseBuilder, B)
Deconstruct the response back into a response builder and the body.
Sourcepub fn take_upgrade_request(&mut self) -> Option<UpgradeRequest>
pub fn take_upgrade_request(&mut self) -> Option<UpgradeRequest>
Take the connection upgrade request (if any).
Methods from Deref<Target = Response<B>>§
Sourcepub fn header(&self) -> &ResponseHeader
pub fn header(&self) -> &ResponseHeader
Get the response header.
Sourcepub fn status_code(&self) -> u16
pub fn status_code(&self) -> u16
Get the status code.
Sourcepub fn status_message(&self) -> &StatusMessage
pub fn status_message(&self) -> &StatusMessage
Get the status message.
Sourcepub fn get_all_header_fields(&self) -> Iter<'_> ⓘ
pub fn get_all_header_fields(&self) -> Iter<'_> ⓘ
Get all header fields.
Sourcepub fn get_header_fields<'a, N>(&'a self, name: &'a N) -> FieldIter<'a> ⓘ
pub fn get_header_fields<'a, N>(&'a self, name: &'a N) -> FieldIter<'a> ⓘ
Get header fields corresponding to a given name.
Sourcepub fn get_header_field<'a, N>(&'a self, name: &'a N) -> Option<&'a HeaderField>
pub fn get_header_field<'a, N>(&'a self, name: &'a N) -> Option<&'a HeaderField>
Get the last header field of a given name.
Sourcepub fn get_header_field_value<'a, N>(
&'a self,
name: &'a N,
) -> Option<&'a HeaderFieldValue>
pub fn get_header_field_value<'a, N>( &'a self, name: &'a N, ) -> Option<&'a HeaderFieldValue>
Get value of the last header field with a given name.
Trait Implementations§
Source§impl<B> AsRef<Response<B>> for OutgoingResponse<B>
impl<B> AsRef<Response<B>> for OutgoingResponse<B>
Source§impl<B> Borrow<Response<B>> for OutgoingResponse<B>
impl<B> Borrow<Response<B>> for OutgoingResponse<B>
Auto Trait Implementations§
impl<B> Freeze for OutgoingResponse<B>
impl<B = Body> !RefUnwindSafe for OutgoingResponse<B>
impl<B> Send for OutgoingResponse<B>where
B: Send,
impl<B> Sync for OutgoingResponse<B>where
B: Sync,
impl<B> Unpin for OutgoingResponse<B>
impl<B = Body> !UnwindSafe for OutgoingResponse<B>
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