LambdaResponseProcessor

Trait LambdaResponseProcessor 

Source
pub trait LambdaResponseProcessor<T: Send + Sync + Clone> {
    // Required methods
    fn prepare_request(&self, req: Request) -> Result<T, Error>;
    fn to_response<'life0, 'async_trait>(
        &'life0 self,
        data: T,
    ) -> Pin<Box<dyn Future<Output = Result<Content, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn to_body<'life0, 'async_trait>(
        &'life0 self,
        content: Content,
        data: T,
    ) -> Pin<Box<dyn Future<Output = Result<Content, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn prepare_request(&self, req: Request) -> Result<T, Error>

§Errors
  • If the request fails to prepare
Source

fn to_response<'life0, 'async_trait>( &'life0 self, data: T, ) -> Pin<Box<dyn Future<Output = Result<Content, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn to_body<'life0, 'async_trait>( &'life0 self, content: Content, data: T, ) -> Pin<Box<dyn Future<Output = Result<Content, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§