pub struct TestResponse { /* private fields */ }Expand description
The result of a dispatched test request.
Implementations§
Source§impl TestResponse
impl TestResponse
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Return the value of the first header matching name (case-insensitive).
Sourcepub fn body_bytes(&self) -> &[u8] ⓘ
pub fn body_bytes(&self) -> &[u8] ⓘ
Raw response body bytes.
Sourcepub fn body_text(&self) -> &str
pub fn body_text(&self) -> &str
Response body decoded as UTF-8. Panics if the body is not valid UTF-8.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
true if the status code is 2xx.
Auto Trait Implementations§
impl Freeze for TestResponse
impl RefUnwindSafe for TestResponse
impl Send for TestResponse
impl Sync for TestResponse
impl Unpin for TestResponse
impl UnsafeUnpin for TestResponse
impl UnwindSafe for TestResponse
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