run

Function run 

Source
pub fn run<H, Args>(handler: H)
where H: Handler<Args>, H::Output: IntoResponse,
Expand description

Runs a handler function, extracting request data and sending the response.

This is the main entry point for handling requests. It:

  1. Creates a new Request from the host
  2. Calls the handler function with extracted data
  3. Converts the result to a Response
  4. 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);
}