Skip to main content

Crate webui_ffi

Crate webui_ffi 

Source
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 NULL if 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.