gotham_ext_responses

Crates.iogotham_ext_responses
lib.rsgotham_ext_responses
version0.0.0
sourcesrc
created_at2019-10-16 14:43:26.34812
updated_at2019-10-16 14:43:26.34812
descriptionProvide gotham response utilities for various types, such as templates
homepage
repositoryhttps://github.com/rakenodiax/gotham_ext_responses
max_upload_size
id173017
size6,243
Kellen Frodelius-Fujimoto (rakenodiax)

documentation

README

(WIP) gotham_ext_responses

Implements gotham::handler::IntoResponse for various types.

Installation

Add gotham_ext_responses as a dependency in Cargo.toml

[dependencies]
gotham_ext_responses = "*"

Usage

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)
}

Code of Conduct

All interactions with this project fall under its code of conduct. Please see the code of conduct file (code-of-conduct.md) for details.

Contributing

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.

License

This project is licensed under either MIT or Apache-2.0

Commit count: 0

cargo fmt