Function lamedh_runtime::run[][src]

pub async fn run<A, B, F>(handler: F) -> Result<(), Error> where
    F: Handler<A, B>,
    <F as Handler<A, B>>::Error: Display,
    A: for<'de> Deserialize<'de>,
    B: Serialize

Starts the Lambda Rust runtime and begins polling for events on the Lambda Runtime APIs.

Example

use lamedh_runtime::{handler_fn, Context, Error};
use serde_json::Value;

#[tokio::main]
async fn main() -> Result<(), Error> {
    let func = handler_fn(func);
    lamedh_runtime::run(func).await?;
    Ok(())
}

async fn func(event: Value, _: Context) -> Result<Value, Error> {
    Ok(event)
}