wrap_handler

Macro wrap_handler 

Source
macro_rules! wrap_handler {
    ($export_name:ident, $handler_fn:ident) => { ... };
}
Expand description

Wraps a handler function to handle FFI details automatically

Converts: fn(Context) -> Result<Response> into extern "C" fn(i32, i32) -> i32

§Usage

// Define your handler function
fn my_handler_impl(ctx: Context) -> Result<Response> {
    Ok(Response::json(&json!({"status": "ok"}))?)
}

// Wrap it for FFI export
wrap_handler!(my_handler, my_handler_impl);