pub fn say_hello(state: State) -> (State, Response) {
    let mut context = Context::new();
    context.add("user", "Gotham");
    let rendered = TERA.render("example.html.tera", &context).unwrap();

    let res = create_response(
        &state,
        StatusCode::Ok,
        Some((rendered.into_bytes(), mime::TEXT_HTML)),
    );

    (state, res)
}
/// Create a `Handler` which calls the Tera static reference, renders
/// a template with a given Context, and returns the result as a String
/// to be used as Response Body
Create a `Handler` which calls the Tera static reference, renders
a template with a given Context, and returns the result as a String
to be used as Response Body
Create a ` Handler ` which calls the Tera static reference renders a template with a given Context and returns the result as a String to be used as Response Body
pub fn say_hello(state: State) -> (State, Response) {
    let mut context = Context::new();
    context.add("user", "Gotham");
    let rendered = TERA.render("example.html.tera", &context).unwrap();
    let res = create_response(
        &state,
        StatusCode::Ok,
        Some((rendered.into_bytes(), mime::TEXT_HTML)),
    );
    (state, res)
}
pub fn say_hello ( state : State ) -> ( State , Response ) { let mut context = Context :: new ( ) ; context . add ( " " , " " ) ; let rendered = TERA . render ( " " , & context ) . unwrap ( ) ; let res = create_response ( & state , StatusCode :: Ok , Some ( ( rendered . into_bytes ( ) , mime :: TEXT_HTML ) ) , ) ; ( state , res ) }
Create a `Handler` which calls the Tera static reference, renders
a template with a given Context, and returns the result as a String
to be used as Response Body
Create a ` Handler ` which calls the Tera static reference renders a template with a given Context and returns the result as a String to be used as Response Body
state
State
state
State