pub struct HandlerSignature {
pub fn_name: String,
pub fn_span: Span,
pub state_type: Option<Type>,
pub input_type: Option<Type>,
pub query_type: Option<Type>,
pub path_params: Vec<(String, Type)>,
pub output_type: Type,
pub error_type: Option<Type>,
pub is_streaming: bool,
pub is_async: bool,
}Expand description
Fully analysed handler function signature.
Produced by extract_handler_signature. All fields are resolved against
the actual AST — no string-based type inference.
Fields§
§fn_name: StringThe function’s identifier, e.g. "list_planets".
fn_span: SpanSpan of the function identifier for error reporting.
state_type: Option<Type>The S in a State<S> parameter, if present.
input_type: Option<Type>The T in a Json<T> parameter, if present.
query_type: Option<Type>The T in a Query<T> parameter, if present.
path_params: Vec<(String, Type)>Ordered list of (binding_name, rust_type) pairs from Path<T> parameters.
E.g., Path(id): Path<i32> → [("id", Type::i32)]
Multiple params: Path(id): Path<i32>, Path(slug): Path<String> → [("id", i32), ("slug", String)]
output_type: TypeThe resolved output type:
Json<T>return →TResult<Json<T>, E>return →TSse<...>return → unit()(output type comes fromdataattribute)
error_type: Option<Type>The E in Result<_, E>, if present.
is_streaming: boolWhether the handler returns Sse<...> (an SSE streaming response).
is_async: boolWhether the function is declared async.