Trait IntoResponseParts
trait IntoResponseParts
Trait for adding headers and extensions to a response.
Example
use ;
// Hypothetical helper type for setting a single header
;
// It's also recommended to implement `IntoResponse` so `SetHeader` can be used on its own as
// the response
// We can now return `SetHeader` in responses
//
// Note that returning `impl IntoResponse` might be easier if the response has many parts to
// it. The return type is written out here for clarity.
async
// Or on its own as the whole response
async
Associated Types
type Error: TraitBound { trait_: Path { path: "IntoResponse", id: Id(175), args: None }, generic_params: [], modifier: None }The type returned in the event of an error.
This can be used to fallibly convert types into headers or extensions.
Required Methods
fn into_response_parts(self: Self, res: ResponseParts) -> Result<ResponseParts, <Self as >::Error>Set parts of the response
Implementors
impl<T1, T2> IntoResponseParts for (T1, T2)impl<T1, T2, T3, T4, T5, T6> IntoResponseParts for (T1, T2, T3, T4, T5, T6)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)impl IntoResponseParts for ()impl IntoResponseParts for HeaderMapimpl<T1, T2, T3> IntoResponseParts for (T1, T2, T3)impl<T1, T2, T3, T4, T5, T6, T7> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)impl<K, V, N: usize> IntoResponseParts for [(K, V); N]impl<T1, T2, T3, T4> IntoResponseParts for (T1, T2, T3, T4)impl<T1, T2, T3, T4, T5, T6, T7, T8> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)impl<I, K, V> IntoResponseParts for AppendHeaders<I>impl<T1> IntoResponseParts for (T1)impl<T1, T2, T3, T4, T5> IntoResponseParts for (T1, T2, T3, T4, T5)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9)impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> IntoResponseParts for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)impl IntoResponseParts for Extensionsimpl<T> IntoResponseParts for Option<T>