IntoResponseFuture

Trait IntoResponseFuture 

Source
pub trait IntoResponseFuture {
    // Required method
    fn into_response_future(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>;
}
Expand description

Trait for Futures that return a valid response for crate::Returning

See IntoResponse for supported return types.

§Example

let fut = async { "hello" };
let res_fut = fut.into_response_future();

Required Methods§

Source

fn into_response_future( self, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Return a Future that resolves to Result<Response<String>, BoxError>

Implementors§

Source§

impl<F> IntoResponseFuture for F
where F: Future + Send + Sync + 'static, F::Output: IntoResponse,