MCPcopy Create free account
hub / github.com/actix/examples / user

Function user

templating/fluent/src/main.rs:39–51  ·  view source on GitHub ↗
(
    hb: web::Data<Handlebars<'_>>,
    Path(info): Path<(String, String)>,
    lang: LangChoice,
)

Source from the content-addressed store, hash-verified

37
38#[get("/{user}/{data}")]
39async fn user(
40 hb: web::Data<Handlebars<'_>>,
41 Path(info): Path<(String, String)>,
42 lang: LangChoice,
43) -> impl Responder {
44 let data = json!({
45 "lang": lang,
46 "user": info.0,
47 "data": info.1
48 });
49 let body = hb.render("user", &data).unwrap();
50 web::Html::new(body)
51}
52
53#[actix_web::main]
54async fn main() -> io::Result<()> {

Callers

nothing calls this directly

Calls 1

renderMethod · 0.80

Tested by

no test coverage detected