pub fn run<H, Args>(handler: H)Expand description
Runs a handler function, extracting request data and sending the response.
This is the main entry point for handling requests. It:
- Creates a new Request from the host
- Calls the handler function with extracted data
- Converts the result to a Response
- Sends the response to the host
§Example
ⓘ
use wasm_runner_sdk::prelude::*;
fn my_handler() -> impl IntoResponse {
"Hello, World!"
}
#[no_mangle]
pub extern "C" fn _start() {
run(my_handler);
}