Skip to main content

extract_handler_signature

Function extract_handler_signature 

Source
pub fn extract_handler_signature(func: &ItemFn) -> Result<HandlerSignature>
Expand description

Extract a HandlerSignature from a handler function.

Validates:

  • The return type is Json<T> or Result<Json<T>, E> (not a bare type)
  • Collects State<S>, Json<T>, and Query<T> parameters when present

Handlers that return neither Json<T> nor Result<Json<T>, E> are rejected with an error pointing at the return type token.