Skip to main content

Response

Trait Response 

Source
pub trait Response {
    // Required methods
    fn status(&self) -> StatusCode;
    fn json<'a>(self) -> LocalBoxFuture<'a, Option<Value>>;
    fn headers(&self) -> HeaderMap;
}
Expand description

A generic http response representation with convenience methods for subsequent assertions with Assert.

Required Methods§

Source

fn status(&self) -> StatusCode

Returns the http status code.

Source

fn json<'a>(self) -> LocalBoxFuture<'a, Option<Value>>

Returns a future with the response json body.

Source

fn headers(&self) -> HeaderMap

Returns the response headers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Response for Response

Implementors§