Skip to main content

run_json_handler_function

Function run_json_handler_function 

Source
pub fn run_json_handler_function<F, Req, Resp, Params>(
    f: F,
    handler_name: &'static str,
    json_body: &str,
    world: &mut World,
) -> Result<String, String>
where F: IntoHandler<Req, Resp, Params>, Req: DeserializeOwned + 'static, Resp: Serialize + 'static,
Expand description

JSON boundary helper for any function that implements IntoHandler.

Builds a fresh boxed handler from f each call (same cost model as per-request into_handler in generated glue). When f is a concrete function item, Req, Resp, and Params are inferred from its type.

Generated axum routes use the #[handler]-emitted {name}__galeon_axum_json shim for handlers with ECS SystemParam extras, because bare .into_handler(...) on a function path often cannot infer Params.