Crates.io | gotham_ext_responses |
lib.rs | gotham_ext_responses |
version | 0.0.0 |
source | src |
created_at | 2019-10-16 14:43:26.34812 |
updated_at | 2019-10-16 14:43:26.34812 |
description | Provide gotham response utilities for various types, such as templates |
homepage | |
repository | https://github.com/rakenodiax/gotham_ext_responses |
max_upload_size | |
id | 173017 |
size | 6,243 |
Implements gotham::handler::IntoResponse
for various types.
Add gotham_ext_responses as a dependency in Cargo.toml
[dependencies]
gotham_ext_responses = "*"
use askama::Template;
use gotham_ext_responses::IntoResponseExt;
/// Askama templates are the first type to be implemented
#[derive(Debug, Template)
#[template_name(path = "example.html")]
struct Example<'a {
name: &'a str,
}
fn handler(state: State) -> (State, Example) {
let example = Example { name: "Alice" };
(state, example)
}
All interactions with this project fall under its code of conduct. Please see the code of conduct file (code-of-conduct.md
) for details.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
All contributions fall under the project code of conduct.
Please make sure to update tests as appropriate.
This project is licensed under either MIT or Apache-2.0