Skip to main content

webui_render

Function webui_render 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn webui_render( html: *const c_char, data_json: *const c_char, ) -> *mut c_char
Expand description

Parse an HTML template and render it with JSON data in a single call.

This is the recommended entry point for Go, C#, and Python consumers. It eliminates the need for callers to deal with protobuf serialisation.

§Arguments

  • html - Null-terminated UTF-8 string containing the HTML template.
  • data_json - Null-terminated UTF-8 JSON string with the render state.

§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

Both html and data_json must be valid null-terminated UTF-8 strings.