pub struct Response { /* private fields */ }Expand description
An HTTP response captured for a page.
Implementations§
Source§impl Response
impl Response
pub fn url(&self) -> &str
pub fn status(&self) -> u16
pub fn status_text(&self) -> &str
pub fn ok(&self) -> bool
pub fn headers(&self) -> &Headers
pub fn from_cache(&self) -> bool
pub fn from_service_worker(&self) -> bool
pub fn request(&self) -> Request
Sourcepub async fn body(&self) -> Result<Vec<u8>>
pub async fn body(&self) -> Result<Vec<u8>>
Fetch the response body (cached after the first call).
pub async fn text(&self) -> Result<String>
pub async fn json(&self) -> Result<Value>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl !UnwindSafe for Response
impl Freeze for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin 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