tower_web/response/
mod.rs

1//! Types and traits for responding to HTTP requests.
2//!
3//! The [`Response`] trait is implemented by types that can be converted to an
4//! HTTP response. Resource methods must return futures that yield types
5//! implementing [`Response`].
6//!
7//! Currently, [`Response`] implementations are provided for the following
8//! types:
9//!
10//! * [`String`](https://doc.rust-lang.org/std/string/struct.String.html)
11//! * [`&'static str`](https://doc.rust-lang.org/std/primitive.str.html)
12//! * [`http::Response`](https://docs.rs/http/0.1/http/response/struct.Response.html)
13//! * [`serde_json::Value`](https://docs.rs/serde_json/1/serde_json/enum.Value.html)
14//! * [`tokio::fs::File`](https://docs.rs/tokio-fs/0.1/tokio_fs/file/struct.File.html)
15//!
16//! More implementations can be added by submitting a PR.
17//!
18//! Also, [`Response`] can be implemented for custom types by using the
19//! [`derive(Response)`] proc macro. See [library level][lib] documentation for
20//! more details.
21//!
22//! [`Response`]: trait.Response.html
23//! [lib]: ../index.html
24
25mod content_type;
26mod context;
27mod default_serializer;
28mod either;
29mod file;
30mod json;
31mod option;
32mod response;
33mod serde;
34mod serializer;
35mod serializer_context;
36mod str;
37mod vec;
38
39pub use self::content_type::ContentType;
40pub use self::context::Context;
41pub use self::default_serializer::DefaultSerializer;
42pub use self::response::Response;
43pub use self::serde::SerdeResponse;
44pub use self::serializer::Serializer;
45pub use self::serializer_context::SerializerContext;