pub struct Response { /* private fields */ }Implementations§
Source§impl Response
impl Response
pub fn status(&self) -> u16
pub fn status_code(&self) -> StatusCode
pub fn is_success(&self) -> bool
pub fn is_error(&self) -> bool
pub fn headers(&self) -> &HeaderMap
pub fn header(&self, key: &str) -> Option<&str>
pub fn duration(&self) -> Duration
pub fn body_bytes(&self) -> &[u8] ⓘ
pub fn text(&self) -> Result<String>
pub fn json<T: DeserializeOwned>(&self) -> Result<T>
pub fn json_value(&self) -> Result<Value>
pub fn expect_status(self, expected: u16) -> Result<Self>
pub fn expect_success(self) -> Result<Self>
pub fn expect_error(self) -> Result<Self>
pub fn expect_json(self) -> Result<Self>
pub fn expect_text(self) -> Result<Self>
pub fn expect_body_contains(self, text: &str) -> Result<Self>
pub fn expect_header(self, key: &str, expected: &str) -> Result<Self>
pub fn expect_content_type(self, content_type: &str) -> Result<Self>
pub fn assert_field( self, path: &str, expected: impl Into<Value>, ) -> Result<Self>
pub fn assert_field_exists(self, path: &str) -> Result<Self>
pub fn assert_array_length( self, path: &str, expected_length: usize, ) -> Result<Self>
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