Skip to main content

webui_handler_render

Function webui_handler_render 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn webui_handler_render( handler_ptr: *mut c_void, protocol_data: *const u8, protocol_len: usize, data_json: *const c_char, entry_id: *const c_char, request_path: *const c_char, ) -> *mut c_char
Expand description

Render a WebUI protocol (protobuf binary) with JSON data.

§Arguments

  • handler_ptr - Pointer returned by webui_handler_create.
  • protocol_data - Pointer to protobuf binary data.
  • protocol_len - Length of the protobuf data in bytes.
  • data_json - Null-terminated JSON string with the render state.
  • entry_id - Null-terminated UTF-8 string for the entry fragment.
  • request_path - Null-terminated UTF-8 string for the URL path to match routes against (e.g., "/contacts/42").

§Returns

A pointer to a null-terminated UTF-8 string with the rendered HTML, or NULL on error. The caller must free the returned string with webui_free. On error, call webui_last_error for details.

§Safety

  • handler_ptr must be a valid pointer returned by webui_handler_create.
  • protocol_data must point to protocol_len bytes of valid memory.
  • data_json, entry_id, and request_path must be valid null-terminated UTF-8 strings.