Struct poem::test::TestResponse
source[−]pub struct TestResponse(_);
test
only.Expand description
A response object for testing.
Implementations
Consumes this object and returns the Response
.
Asserts that the status code is equals to status
.
Asserts that the status code is 200 OK
.
pub fn assert_header<K, V>(&self, key: K, value: V) where
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
pub fn assert_header<K, V>(&self, key: K, value: V) where
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
Asserts that header key
is equals to value
.
Asserts that content type is equals to content_type
.
Asserts that the response body is utf8 string and it equals to text
.
Asserts that the response body is bytes and it equals to bytes
.
Asserts that the response body is JSON and it equals to json
.
Consumes this object and return the SSE events stream.
pub fn typed_sse_stream<T: DeserializeOwned + 'static>(
self
) -> impl Stream<Item = T> + Send + Unpin + 'static
pub fn typed_sse_stream<T: DeserializeOwned + 'static>(
self
) -> impl Stream<Item = T> + Send + Unpin + 'static
Consumes this object and return the SSE events stream which deserialize
the message data to T
.
Auto Trait Implementations
impl !RefUnwindSafe for TestResponse
impl Send for TestResponse
impl Sync for TestResponse
impl Unpin for TestResponse
impl !UnwindSafe for TestResponse
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more