MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / from_reader

Function from_reader

lambda-http/src/request.rs:505–510  ·  view source on GitHub ↗

Deserializes a `Request` from a `Read` impl providing JSON events. # Example ```rust,no_run use lambda_http::request::from_reader; use std::fs::File; use std::error::Error; fn main() -> Result<(), Box > { let request = from_reader( File::open("path/to/request.json")? )?; Ok(println!("{:#?}", request)) } ```

(rdr: R)

Source from the content-addressed store, hash-verified

503/// }
504/// ```
505pub fn from_reader<R>(rdr: R) -> Result<crate::Request, JsonError>
506where
507 R: Read,
508{
509 serde_json::from_reader(rdr).map(LambdaRequest::into)
510}
511
512/// Deserializes a `Request` from a string of JSON text.
513///

Callers 2

visit_mapMethod · 0.85

Calls

no outgoing calls