pub struct Response<B> { /* private fields */ }
Expand description
HTTP response.
Implementations§
Source§impl<B> Response<B>
impl<B> 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.
Sourcepub fn deconstruct(self) -> (ResponseHeader, B)
pub fn deconstruct(self) -> (ResponseHeader, B)
Deconstruct the response back into a response builder and the body.
Trait Implementations§
Source§impl<B> AsRef<Response<B>> for OutgoingResponse<B>
Available on crate feature server
only.
impl<B> AsRef<Response<B>> for OutgoingResponse<B>
Available on crate feature
server
only.Auto Trait Implementations§
impl<B> !Freeze for Response<B>
impl<B> RefUnwindSafe for Response<B>where
B: RefUnwindSafe,
impl<B> Send for Response<B>where
B: Send,
impl<B> Sync for Response<B>where
B: Sync,
impl<B> Unpin for Response<B>where
B: Unpin,
impl<B> UnwindSafe for Response<B>where
B: UnwindSafe,
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