The handlers are less hard to reason about then a lot of macros.
You don't have to understand the type magic which makes them work.
At least if you look at the more relevant frameworks (actix-web, axume) they basically boil down to calling a
fn foo(x: A, y: B) -> Result<Body, Error>
as roughly
let x = A::from_request(&req, &mut payload).await?;
let y = B::from_request(&req, &mut payload).await?;
foo(x, y)?;
and _nothing_ more.
There is no special handle first/last parameter different logic or anything.
They way they handle not copying the payload (request body) is by moving it (a reference to it) out of the request (or here payload).
The reason the performance for micro-benchmarking extractors is different depending on the order has less to do with the general design and more the typical "I reordered parameters and now optimizations trigger differently" problem. (Probably some in-lining and const propagation allowing eliminating some checks but just on one order, anyway not specific to web frameworks at all and can also happen with their approach, but probably less likely if I should guess).
You don't have to understand the type magic which makes them work.
At least if you look at the more relevant frameworks (actix-web, axume) they basically boil down to calling a
fn foo(x: A, y: B) -> Result<Body, Error>
as roughly
let x = A::from_request(&req, &mut payload).await?; let y = B::from_request(&req, &mut payload).await?; foo(x, y)?;
and _nothing_ more.
There is no special handle first/last parameter different logic or anything.
They way they handle not copying the payload (request body) is by moving it (a reference to it) out of the request (or here payload).
The reason the performance for micro-benchmarking extractors is different depending on the order has less to do with the general design and more the typical "I reordered parameters and now optimizations trigger differently" problem. (Probably some in-lining and const propagation allowing eliminating some checks but just on one order, anyway not specific to web frameworks at all and can also happen with their approach, but probably less likely if I should guess).