1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! The buffered HTTP pipeline for API Gateway and Function URL requests.
//!
//! One ordered pipeline serves one route; this is not a web framework. See
//! [`Api`] for the steps, [`Request`] for bounded reads, [`Failure`] for safe
//! public error messages and [`ErrorRenderer`] for the wire shape of errors. HTTP
//! API and Function URL events are read by default; REST API events
//! need the `apigw-rest` feature.
//!
//! # Examples
//!
//! ```no_run
//! use std::sync::Arc;
//!
//! use davidrs::http::{Api, Failure, Json, PlainErrors, Public, Request};
//! use davidrs::{Context, RuntimeError};
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug)]
//! struct App {
//! greeting: String,
//! }
//!
//! #[derive(Debug, Deserialize)]
//! struct HelloPath {
//! name: String,
//! }
//!
//! #[derive(Debug, Serialize)]
//! struct Greeting {
//! message: String,
//! }
//!
//! async fn hello(app: Arc<App>, input: HelloPath, _context: Context<()>) -> Result<Json<Greeting>, Failure> {
//! Ok(Json(Greeting { message: format!("{}, {}", app.greeting, input.name) }))
//! }
//!
//! # async fn run() -> Result<(), RuntimeError> {
//! let app = Arc::new(App { greeting: "Hello".to_owned() });
//! let operation = "hello";
//!
//! Api::new(operation, Public, PlainErrors::default())
//! .run(app, |request: &Request| request.path::<HelloPath>(), hello)
//! .await
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Body;
pub use ;
pub use ProblemErrors;