Trying to implement POST handler in Axum, I can't find anything beyond most basic examples.
- official docs just shows the signature.
- a discussion in the forum shows a real example with some real parameters, but not app state.

- examples in axum repo show a form and a basic handler that accepts only the form struct, not app state.
How do I put both the state and form data in the handler signature?
Here's what I made by active guessing:
...route("/data/v1/move/", post(do_move))
#[derive(Deserialize, Debug)]
pub struct MoveRequest { point_id: PointId, dist: f32 }
async fn do_move(Form(_mr): Form<MoveRequest>, State(ast): State<MyAppState>) -> Result<(HeaderMap, Bytes), (StatusCode, String)> {
Ok((HeaderMap::new(), Bytes::from("updated ok")))
}
Produces compilation error:
the trait bound `fn(Form<MoveRequest>, axum::extract::State<MyAppState>) -> impl Future<Output = Result<(HeaderMap, axum::body::Bytes), (StatusCode, std::string::String)>> {move_platform}: Handler<_, _>` is not satisfied
the following other types implement trait `Handler<T, S>`:
<Layered<L, H, T, S> as Handler<T, S>>
<MethodRouter<S> as Handler<(), S>>
No idea what's wrong here. Function do_move did work before I added the first parameter (Form<MoveRequest>).