-
SummaryI'm working on a project at https://git.sr.ht/~latex/streamlist
It seems that in the documentation, there is some conflicting info. I designed this around the example in https://docs.rs/axum/latest/axum/middleware/index.html#towerservice-and-pinboxdyn-future but I also need to access the state, which an example is shown for in https://docs.rs/axum/latest/axum/middleware/index.html#accessing-state-in-custom-towerlayers which doesn't seem to have Box::pin or anything like that so that is very confusing. What am I supposed to do here? I want to return a response and not some request. Another issue seems to be about the way I am using fallback_service. It says that it expected an argument but saw 0, which is odd because I clearly gave it an argument. What's going on here?
fallback_service sounded like the thing that came closest to what I want to achieve but now I'm not so sure. Any ideas about what I can use? Or how I can fix the error? Thanks in advance. axum version0.7.7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I changed the code to use |
Beta Was this translation helpful? Give feedback.
I changed the code to use
middleware::from_fn_with_state
and that fixed the errors.