You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
went to give maud a shot today and it looks like axum is unhappy with it for now.
use axum::{
routing::{get, post},
http::StatusCode,Json,Router,};use serde::{Deserialize,Serialize};use maud::{html,Markup};asyncfnhello_world() -> Markup{html!{
h1 {"Hello, World!"}}}#[tokio::main]asyncfnmain(){// build our application with a routelet app = Router::new().route("/",get(hello_world));// run our app with hyperlet listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();}
error[E0277]: the trait bound fn() -> impl Future<Output = PreEscaped<std::string::String>> {hello_world}: Handler<_, _> is not satisfied
--> src/main.rs:14:25
|
14 | .route("/", get(hello_world));
| --- ^^^^^^^^^^^ the trait Handler<_, _> is not implemented for fn item fn() -> impl Future<Output = PreEscaped<std::string::String>> {hello_world}
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait Handler<T, S>:
<Layered<L, H, T, S> as Handler<T, S>>
<MethodRouter as Handler<(), S>>
Reverting to axum 0.6.2 fixed things, so maybe an update to the website to state version compatibility would be nice.
I have no idea how to go about implementing the handler trait for Markup.
The text was updated successfully, but these errors were encountered:
went to give maud a shot today and it looks like axum is unhappy with it for now.
error[E0277]: the trait bound
fn() -> impl Future<Output = PreEscaped<std::string::String>> {hello_world}: Handler<_, _>
is not satisfied--> src/main.rs:14:25
|
14 | .route("/", get(hello_world));
| --- ^^^^^^^^^^^ the trait
Handler<_, _>
is not implemented for fn itemfn() -> impl Future<Output = PreEscaped<std::string::String>> {hello_world}
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait
Handler<T, S>
:<Layered<L, H, T, S> as Handler<T, S>>
<MethodRouter
as Handler<(), S>>Reverting to axum 0.6.2 fixed things, so maybe an update to the website to state version compatibility would be nice.
I have no idea how to go about implementing the handler trait for Markup.
The text was updated successfully, but these errors were encountered: