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.
Load a compiled protocol once with webui_protocol_create, then reuse the
handle with webui_handler_render and the other protocol operations.
§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).
Constants§
- WEBUI_
BOUNDARY_ KEY_ NONE - The boundary declaration has no runtime key.
- WEBUI_
BOUNDARY_ KEY_ NUMBER - The boundary key is a finite JSON number.
- WEBUI_
BOUNDARY_ KEY_ STRING - The boundary key is a UTF-8 string.
- WEBUI_
BOUNDARY_ MODE_ FINAL - Commit the boundary once and release its boundary-local roots.
- WEBUI_
BOUNDARY_ MODE_ UPDATABLE - Retain live roots until terminal so updates may target the boundary.
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 using a protocol previously returned by
webui_protocol_create. - webui_
handler_ ⚠set_ nonce - Set the CSP nonce for inline
<script>tags on a handler instance. - webui_
last_ error - Return the last error message, or
NULLif no error has occurred. - webui_
protocol_ ⚠create - Decode and index a WebUI protocol for repeated rendering.
- webui_
protocol_ ⚠destroy - Destroy a loaded WebUI protocol handle.
- webui_
protocol_ ⚠render_ component_ templates - Render component templates using a loaded protocol handle.
- webui_
protocol_ ⚠render_ partial - Produce a complete partial response using a loaded protocol handle.
- webui_
protocol_ ⚠tokens - Extract CSS token names from a loaded protocol handle.
- webui_
render_ ⚠bytes - Borrow a rendered document and write its length in bytes to
out_len. - webui_
render_ ⚠free - Release a document returned by
webui_handler_render. - webui_
streaming_ ⚠session_ advance - Advance through parent bytes to the next occurrence or terminal completion.
- webui_
streaming_ ⚠session_ create - Open a host-driven progressive response for a streaming entry.
- webui_
streaming_ ⚠session_ destroy - Release a streaming session handle.
- webui_
streaming_ ⚠session_ resume - Commit the pending occurrence through its checkpoint and stop.
- webui_
streaming_ ⚠session_ start - Render until the first runtime boundary occurrence or terminal completion.
- webui_
streaming_ ⚠session_ update - Emit a projected state patch for a committed updatable occurrence.
- webui_
streaming_ ⚠step_ boundary_ declaration_ id - Read the pending boundary’s stable compiler declaration ID.
- webui_
streaming_ ⚠step_ boundary_ instance_ id - Read the pending boundary’s response-local instance ID.
- webui_
streaming_ ⚠step_ boundary_ key_ number - Read the pending boundary’s numeric key.
- webui_
streaming_ ⚠step_ boundary_ key_ string - Borrow the pending boundary’s string key as UTF-8 bytes.
- webui_
streaming_ ⚠step_ boundary_ key_ type - Read the pending boundary key discriminator.
- webui_
streaming_ ⚠step_ boundary_ name - Borrow the pending boundary name’s UTF-8 bytes.
- webui_
streaming_ ⚠step_ boundary_ owner - Borrow the pending boundary owner’s UTF-8 bytes.
- webui_
streaming_ ⚠step_ bytes - Borrow the bytes produced by this step and write their length to
out_len. - webui_
streaming_ ⚠step_ destroy - Release an owned streaming step.
- webui_
streaming_ ⚠step_ done - Observe whether this step emitted the terminal record.
- webui_
streaming_ ⚠step_ has_ boundary - Observe whether this step carries a pending boundary descriptor.
Type Aliases§
- webui_
boundary_ key_ type_ t - C-safe boundary key discriminator returned by
webui_streaming_step_boundary_key_type. - webui_
boundary_ mode_ t - C-safe boundary mode value accepted by
webui_streaming_session_resume. - webui_
protocol_ t - Opaque C handle for a loaded WebUI protocol.
- webui_
render_ t - Opaque owned document returned by
webui_handler_render. - webui_
streaming_ session_ t - Opaque C handle for a host-driven progressive response.
- webui_
streaming_ step_ t - Opaque owned result from one streaming start, resume, or advance call.