pub struct Response<T> { /* private fields */ }Expand description
HTTP response message.
Implementations§
Source§impl<T> Response<T>
impl<T> Response<T>
Sourcepub fn new(
version: HttpVersion,
status: StatusCode,
reason: ReasonPhrase<'_>,
body: T,
) -> Self
pub fn new( version: HttpVersion, status: StatusCode, reason: ReasonPhrase<'_>, body: T, ) -> Self
Makes a new Response instance with the given status-line components and body.
Sourcepub fn http_version(&self) -> HttpVersion
pub fn http_version(&self) -> HttpVersion
Returns the HTTP version of the response.
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Returns the status code of the response.
Sourcepub fn reason_phrase(&self) -> ReasonPhrase<'_>
pub fn reason_phrase(&self) -> ReasonPhrase<'_>
Returns the reason phrase of the response.
Sourcepub fn header_mut(&mut self) -> HeaderMut<'_>
pub fn header_mut(&mut self) -> HeaderMut<'_>
Returns the mutable header of the response.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Response<T>where
T: Freeze,
impl<T> RefUnwindSafe for Response<T>where
T: RefUnwindSafe,
impl<T> Send for Response<T>where
T: Send,
impl<T> Sync for Response<T>where
T: Sync,
impl<T> Unpin for Response<T>where
T: Unpin,
impl<T> UnwindSafe for Response<T>where
T: 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