What's this syntax in Rust function arguments? (axum docs)
I'm looking at the axum documentation and noticed a new syntax, that I'm unfamiliar with.
async fn get_user(Path(user_id): Path<String>, state: Arc<AppState>) { }
async fn create_user(Json(payload): Json<CreateUserPayload>, state: Arc<AppState>) { }
What's the syntax with the first parameter, in both of those function definitions? Normally function parameters are just the name, followed by the type. But in this case, the parameter names are being wrapped by a struct (Path, and Json).
What is this called, and how does it work? Is it a tuple struct pattern? That's the closest thing I can find, but it doesn't logically make sense to me as a function parameter.