Trait salvo_core::test::ResponseExt
source · pub trait ResponseExt {
// Required methods
fn take_string(&mut self) -> impl Future<Output = Result<String>> + Send;
fn take_json<T: DeserializeOwned>(
&mut self
) -> impl Future<Output = Result<T>> + Send;
fn take_string_with_charset(
&mut self,
content_type: Option<&Mime>,
charset: &str,
compress: Option<&str>
) -> impl Future<Output = Result<String>>;
fn take_bytes(
&mut self,
content_type: Option<&Mime>
) -> impl Future<Output = Result<Bytes>> + Send;
}
Available on crate feature
test
only.Expand description
More utils functions for response.
Required Methods§
sourcefn take_string(&mut self) -> impl Future<Output = Result<String>> + Send
fn take_string(&mut self) -> impl Future<Output = Result<String>> + Send
Take body as String
from response.
sourcefn take_json<T: DeserializeOwned>(
&mut self
) -> impl Future<Output = Result<T>> + Send
fn take_json<T: DeserializeOwned>( &mut self ) -> impl Future<Output = Result<T>> + Send
Take body as deserialize it to type T
instance.
Object Safety§
This trait is not object safe.