Changelog History
-
v0.2.1 Changes
November 28, 2018- ๐ fix version referenced in docs
-
v0.2.0 Changes
November 28, 2018- ease dependency declartions by re-exporting
http
crate
before
... in your
Cargo.toml
file[dependencies] lando = "0.1" http = "0.1" # need to depend on http crate explicitly
... in your
src/lib.rs
#[macro_use] extern crate lando; // need to extern http crate explicitly extern crate http; use http::{Method, StatusCode};
after
... in your
Cargo.toml
[dependencies] lando = "0.2" # no longer need to add a dependency on http explicitly
... in your
src/lib.rs
#[macro_use] extern crate lando; // consume http re-export from lando crate use lando::http::{Method, StatusCode};
- โ remove the need to explicitly declare cpython as a dependency, both as a depenency and macro_use
before
... in your
Cargo.toml
file[dependencies] lando = "0.1" cpython = "0.1" # need to depend on cpython crate explicitly for its macros
... in your
src/lib.rs
file#[macro_use] extern crate lando; // needed because lando's macros used cpython macros, // an impl detail #[macro_use] extern crate cpython;
after
... in your
Cargo.toml
file[dependencies] lando = "0.2" # no longer need to declar cpython as an explicit dependency
... in your
src/lib.rs
file#[macro_use] extern crate lando; // impl details are hidden
- โฌ๏ธ reduced exposed surface area of internal interfaces
lando::GatewayRequest
still is still public (for benchmarking) but its fields are not- โฌ๏ธ reduced cost of transformations between lambda proxy types and rust native
http
crate types
Replaced many owned
String
types withCow
. Now deserializing and serializing request headers and http method directly tohttp::HeaderMap
andhttp::Method
respectivelyRequestExt
methods now return astrmap::StrMap
type instead ofHashMap<String, String>
- introducing
IntoResponse
trait
๐ Handlers can now return anything that implements
lando::IntoResponse
. As a resultlando::Result
type now takes a type parameter as a placeholder those types. Implementations forlando::Response
and types that implementInto<Body>
are provided- introducing
#[lando]
proc macro.
You can now attribute a bare function with
#[lando]
to have it exporteduse lando::{Request, LambdaContext, Result}; #[lando] fn handler<'a>(_: Request, _: LambdaContext) -> Result<&'a str> { Ok("hello lando") }
- ease dependency declartions by re-exporting
-
v0.1.1 Changes
June 06, 2018- ๐ bug fix - support for reading host from "host" (lowercase) in addition to "Host"
- ๐ feature - add support for "application/x-www-form-urlencoded" and "application/json"
parsed request bodies with
lando::RequestExt#payload()
#[macro_use] extern crate cpython; #[macro_use] extern crate lando; #[macro_use] extern crate serde_deserialize; use lando::{Response, RequestEx}; #[derive(Deserialize, Debug)] struct Params { x: usize, y: usize } gateway!( |req, _| => Ok( Response::new( req.payload::<Params>().unwrap_or_else(|_| None).map( |params| format!( "the answer is {}", params.x + params.y ) ).unwrap_or_else( || "try again".to_string() ) ) ) );
-
v0.1.0 Changes
June 04, 2018- ๐ initial release