Expand description
WebUI FFI (Foreign Function Interface) for interoperability with other languages.
This crate provides C-compatible APIs for the WebUI handler to be used from languages like Go, C#, Python, etc.
§Quick Start
The simplest way to render an HTML template with data:
char *result = webui_render("<h1>{{title}}</h1>", "{\"title\":\"Hello\"}");
if (result == NULL) {
const char *err = webui_last_error();
// handle error...
} else {
// use result...
webui_free(result);
}§Error Handling
All functions that can fail return NULL on error. Call webui_last_error to
retrieve a human-readable error message. The error string is valid until the next
FFI call on the same thread (follows the POSIX dlerror() pattern).
Functions§
- webui_
free ⚠ - Free a string returned by a WebUI FFI function.
- webui_
handler_ create - Create a new WebUI handler instance.
- webui_
handler_ ⚠create_ with_ plugin - Create a new WebUI handler instance with a named plugin.
- webui_
handler_ ⚠destroy - Destroy a WebUI handler instance.
- webui_
handler_ ⚠render - Render a WebUI protocol (protobuf binary) with JSON data.
- webui_
last_ error - Return the last error message, or
NULLif no error has occurred. - webui_
render ⚠ - Parse an HTML template and render it with JSON data in a single call.
- webui_
render_ ⚠partial - Produce a complete JSON partial response for client-side navigation.