I am pretty new to Rust language and trying to make with Actix web framework. Now I want to return following closure from one function
let list = || {
App::new()
// enable logger
.wrap(middleware::Logger::default())
.service(web::resource("/index.html").to(|| async { "Hello world!" }))
.service(web::resource("/").to(index::home))
.service(web::resource("/h2").to(index::home2))
};
So, I can consume that with
HttpServer::new(routes::list())
.bind("127.0.0.1:8080")?
.run()
.await
So, what will be the signature of Rust function will be?