pub struct TestResponse(/* private fields */);Expand description
A response returned by EndpointTest.
Implementations§
Source§impl TestResponse
impl TestResponse
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Returns the validated HTTP status.
Sourcepub fn json<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn json<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
Deserializes the response body as JSON.
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Returns the first response header matching name, ignoring ASCII case.
Sourcepub fn into_inner(self) -> HandleResponse
pub fn into_inner(self) -> HandleResponse
Returns the raw portable Endpoint response.
Trait Implementations§
Source§impl Clone for TestResponse
impl Clone for TestResponse
Source§fn clone(&self) -> TestResponse
fn clone(&self) -> TestResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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