pub struct Response { /* private fields */ }Expand description
Represents the HTTP response to an request.
Implementations§
Source§impl Response
impl Response
Sourcepub fn content_type(&self) -> Mime
pub fn content_type(&self) -> Mime
Get the Content-Type header, which specifies which media type
this response is represented with.
Sourcepub fn redirect_location(&self) -> Option<&str>
pub fn redirect_location(&self) -> Option<&str>
Gets the redirect location this response points to, if the response is a redirection.
Sourcepub fn redirect_url(&self) -> Option<Url>
pub fn redirect_url(&self) -> Option<Url>
Gets the redirect location this response points to, if the response is a redirection.
Sourcepub async fn body_bytes(&mut self) -> Bytes
pub async fn body_bytes(&mut self) -> Bytes
TODO: this function is not needed if the BufRead can be somehow
Seek.
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Get the StatusCode of this response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl !RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
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