rama_http::response

Trait IntoResponse

Source
pub trait IntoResponse {
    // Required method
    fn into_response(self) -> Response<Body>;
}
Expand description

Trait for generating responses.

Types that implement IntoResponse can be returned from handlers.

§Implementing IntoResponse

You generally shouldn’t have to implement IntoResponse manually, as rama provides implementations for many common types.

Required Methods§

Source

fn into_response(self) -> Response<Body>

Create a response.

Implementations on Foreign Types§

Source§

impl IntoResponse for &'static str

Source§

impl IntoResponse for &'static [u8]

Source§

impl IntoResponse for Cow<'static, str>

Source§

impl IntoResponse for Cow<'static, [u8]>

Source§

impl IntoResponse for Infallible

Source§

impl IntoResponse for ()

Source§

impl IntoResponse for Box<str>

Source§

impl IntoResponse for Box<[u8]>

Source§

impl IntoResponse for String

Source§

impl IntoResponse for Vec<u8>

Source§

impl IntoResponse for Bytes

Source§

impl IntoResponse for BytesMut

Source§

impl<K, V, const N: usize> IntoResponse for [(K, V); N]

Source§

impl<R> IntoResponse for (Parts, R)
where R: IntoResponse,

Source§

impl<R> IntoResponse for (Response<()>, R)
where R: IntoResponse,

Source§

impl<R> IntoResponse for (StatusCode, R)
where R: IntoResponse,

Source§

impl<R> IntoResponse for (R,)
where R: IntoResponse,

Source§

impl<R, T1> IntoResponse for (Parts, T1, R)

Source§

impl<R, T1> IntoResponse for (Response<()>, T1, R)

Source§

impl<R, T1> IntoResponse for (StatusCode, T1, R)

Source§

impl<R, T1> IntoResponse for (T1, R)

Source§

impl<R, T1, T2> IntoResponse for (Parts, T1, T2, R)

Source§

impl<R, T1, T2> IntoResponse for (Response<()>, T1, T2, R)

Source§

impl<R, T1, T2> IntoResponse for (StatusCode, T1, T2, R)

Source§

impl<R, T1, T2> IntoResponse for (T1, T2, R)

Source§

impl<R, T1, T2, T3> IntoResponse for (Parts, T1, T2, T3, R)

Source§

impl<R, T1, T2, T3> IntoResponse for (Response<()>, T1, T2, T3, R)

Source§

impl<R, T1, T2, T3> IntoResponse for (StatusCode, T1, T2, T3, R)

Source§

impl<R, T1, T2, T3> IntoResponse for (T1, T2, T3, R)

Source§

impl<R, T1, T2, T3, T4> IntoResponse for (Parts, T1, T2, T3, T4, R)

Source§

impl<R, T1, T2, T3, T4> IntoResponse for (Response<()>, T1, T2, T3, T4, R)

Source§

impl<R, T1, T2, T3, T4> IntoResponse for (StatusCode, T1, T2, T3, T4, R)

Source§

impl<R, T1, T2, T3, T4> IntoResponse for (T1, T2, T3, T4, R)

Source§

impl<R, T1, T2, T3, T4, T5> IntoResponse for (Parts, T1, T2, T3, T4, T5, R)

Source§

impl<R, T1, T2, T3, T4, T5> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, R)

Source§

impl<R, T1, T2, T3, T4, T5> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, R)

Source§

impl<R, T1, T2, T3, T4, T5> IntoResponse for (T1, T2, T3, T4, T5, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6> IntoResponse for (T1, T2, T3, T4, T5, T6, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, T8, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, T8, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, T8, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, T8, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, T8, T9, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, T8, T9, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, T8, T9, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, T8, T9, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponse for (Parts, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponse for (Response<()>, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponse for (StatusCode, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R)

Source§

impl<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponse for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, R)

Source§

impl<T> IntoResponse for Result<T, ErrorResponse>
where T: IntoResponse,

Source§

impl<T, E> IntoResponse for Result<T, E>

Source§

impl<T, U> IntoResponse for Chain<T, U>
where T: Buf + Unpin + Send + Sync + 'static, U: Buf + Unpin + Send + Sync + 'static,

Source§

impl<const N: usize> IntoResponse for &'static [u8; N]

Source§

impl<const N: usize> IntoResponse for [u8; N]

Implementors§

Source§

impl IntoResponse for Parts

Source§

impl IntoResponse for Extensions

Source§

impl IntoResponse for UriParamsDeserializeError

Source§

impl IntoResponse for TypedHeaderRejection

Source§

impl IntoResponse for Body

Source§

impl IntoResponse for HeaderMap

Source§

impl IntoResponse for StatusCode

Source§

impl IntoResponse for Redirect

Source§

impl<B> IntoResponse for Response<B>
where B: Body<Data = Bytes> + Send + Sync + 'static, <B as Body>::Error: Into<Box<dyn Error + Sync + Send>>,

Source§

impl<I, K, V> IntoResponse for AppendHeaders<I>

Source§

impl<K, V> IntoResponse for TryIntoHeaderError<K, V>
where K: Display, V: Display,

Source§

impl<T1> IntoResponse for Headers<(T1,)>
where T1: Header,

Source§

impl<T1, T2> IntoResponse for Headers<(T1, T2)>
where T1: Header, T2: Header,

Source§

impl<T1, T2, T3> IntoResponse for Headers<(T1, T2, T3)>
where T1: Header, T2: Header, T3: Header,

Source§

impl<T1, T2, T3, T4> IntoResponse for Headers<(T1, T2, T3, T4)>
where T1: Header, T2: Header, T3: Header, T4: Header,

Source§

impl<T1, T2, T3, T4, T5> IntoResponse for Headers<(T1, T2, T3, T4, T5)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header,

Source§

impl<T1, T2, T3, T4, T5, T6> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7, T8)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header, T8: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header, T8: Header, T9: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header, T8: Header, T9: Header, T10: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header, T8: Header, T9: Header, T10: Header, T11: Header,

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> IntoResponse for Headers<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>
where T1: Header, T2: Header, T3: Header, T4: Header, T5: Header, T6: Header, T7: Header, T8: Header, T9: Header, T10: Header, T11: Header, T12: Header,

Source§

impl<T> IntoResponse for Form<T>
where T: Serialize,

Source§

impl<T> IntoResponse for Html<T>
where T: Into<Body>,

Source§

impl<T> IntoResponse for Json<T>
where T: Serialize,