January 2019
Intermediate to advanced
520 pages
14h 32m
English
We need the following types in our code:
use serde_derive::{Serialize, Deserialize};use lambda_runtime::{lambda, Context, error::HandlerError};use rand::Rng;use rand::distributions::{Bernoulli, Normal, Uniform};use std::error::Error;use std::ops::Range;
It make sense to look at imports from the lambda_runtime crate. The lambda macro is used to export a handler from a binary, which will be used by the AWS Lambda runtime. Context is a required parameter of a handler, and we also have imported HandlerError to use in the returning Result value of a handler.
Then we can write a main function that initializes simple_logger and wraps rng_handler, which we will implement in the following code, to export the handler of ...
Read now
Unlock full access