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
//! Modify response or make a response,but in a strong-typed way.
//!
//! [`Responder`](crate::responder::Responder) is a trait modifying or generating response
//! ```
//! # use skyzen::{utils::Json,Responder};
//! async fn handler() -> impl Responder{
//! Json("Hello,world")
//! }
//!
//! ```
//!
//! Responder can be combined by tuple easily,
//! ```
//! # use skyzen::{utils::Json,header::{CONTENT_TYPE,HeaderValue},Responder};
//! async fn handler() -> impl Responder{
//! (r#""Hello,world""#,(CONTENT_TYPE,HeaderValue::from_static("application/json")))
//! }
//! ```
//! Result<T> is also a responder, it allows you handle error conveniently in handler.
//!
//! ```
//! # use skyzen::{utils::Json,Result,routing::Params,Responder};
//! async fn handler(params:Params) -> Result<impl Responder>{
//! let name=params.get("name")?;
//! Ok(format!("Hello,{name}"))
//! }
//!
//! ```
//!
pub use Responder;
pub use Sse;
pub use PrettyJson;