Trait salvo_core::test::ResponseExt
source · [−]pub trait ResponseExt {
fn take_string<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn take_json<'life0, 'async_trait, T>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where
T: 'async_trait + DeserializeOwned,
'life0: 'async_trait,
Self: 'async_trait;
fn take_string_with_charset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
charset: &'life1 str,
compress: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn take_bytes<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Available on crate feature
test
only.Expand description
More utils functions for response.
Required Methods
Take body as String
from response.
Take body as deserialize it to type T
instance.
fn take_string_with_charset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
charset: &'life1 str,
compress: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn take_string_with_charset<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
charset: &'life1 str,
compress: Option<&'life2 str>
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Take body as String
from response with charset.