titan_lambda/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod lambda_handler_service;
use std::future::Future;

pub use lambda_http::Request;

use lambda_handler_service::LambdaHandlerService;
use titan::{lambda::LambdaAppService, App};
use titan_core::{FromRequest, Handler, Respondable};

pub fn handler_runtime<H, Args>(handler: H) -> LambdaHandlerService<H, Args>
where
  H: Handler<Args> + Clone,
  H::Future: Future<Output = H::Output> + Send,
  H::Output: Respondable,
  Args: FromRequest + Send + Sync + 'static,
  Args::Error: Send,
{
  LambdaHandlerService::new(handler)
}

pub fn app_runtime(app: App) -> LambdaAppService {
  LambdaAppService::new(app)
}