pub struct Response {
inner: Weak<Response>,
}Fields§
§inner: Weak<Response>Implementations§
Source§impl Response
impl Response
pub(crate) fn new(inner: Weak<Impl>) -> Self
pub fn url(&self) -> Result<String, Error>
Sourcepub fn status(&self) -> Result<i32, Error>
pub fn status(&self) -> Result<i32, Error>
Contains the status code of the response (e.g., 200 for a success).
Sourcepub fn status_text(&self) -> Result<String, Error>
pub fn status_text(&self) -> Result<String, Error>
Contains the status text of the response (e.g. usually an “OK” for a success).
Sourcepub fn ok(&self) -> Result<bool, Error>
pub fn ok(&self) -> Result<bool, Error>
Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
pub fn request(&self) -> Request
Sourcepub async fn finished(&self) -> Result<Option<String>, Arc<Error>>
pub async fn finished(&self) -> Result<Option<String>, Arc<Error>>
Waits for this response to finish, returns failure error if request failed.
pub async fn body(&self) -> Result<Vec<u8>, Arc<Error>>
Sourcepub async fn text(&self) -> Result<String, Arc<Error>>
pub async fn text(&self) -> Result<String, Arc<Error>>
Returns the text representation of response body.
Sourcepub async fn headers(&self) -> Result<Vec<Header>, Arc<Error>>
pub async fn headers(&self) -> Result<Vec<Header>, Arc<Error>>
Returns the object with HTTP headers associated with the response. All header names are lower-case.
Sourcepub fn frame(&self) -> Frame
pub fn frame(&self) -> Frame
Shortcut for Response::request’s Request::frame
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