Expand description
WebUI Handler implementation for Rust.
This crate provides functionality to process and render WebUI protocols into final HTML output based on provided data.
Re-exports§
pub use route_handler::Protocol;
Modules§
- css_
module - Shared helpers for emitting CSS module definitions as
<script type="importmap">tags withdata:text/css,…URIs. - plugin
- Handler plugin trait and built-in plugin implementations.
- route_
handler - Route component inventory management for incremental route rendering.
- route_
matcher - Iterative path template matcher for server-side route resolution.
Structs§
- Boundary
Descriptor - Runtime occurrence returned when traversal suspends.
- Boundary
Instance Id - Response-local runtime boundary occurrence identity.
- Buffer
Sink - Reusable byte sink for host-owned sessions.
- Render
Options - Options controlling how the handler renders a protocol.
- Session
Options - Owned per-response configuration.
- Span
Instance Id - Response-local generated component span identity.
- Stream
Status - Borrowed-writer result of one semantic streaming step.
- Stream
Step - Bytes and continuation state returned by one owned semantic step.
- Streaming
Boundary Error - Boxed payload for
HandlerError::StreamingBoundary. - Streaming
Response - A progressive response that writes directly through a
FlushWriter. - Streaming
Session - A progressive response owned independently of any Rust borrow.
- WebUI
Handler - The main WebUI handler that processes protocols and renders them.
Enums§
- Boundary
Key - Valid evaluated key for a repeated boundary declaration.
- Boundary
Mode - Whether a committed occurrence may receive later state updates.
- Handler
Error - Error types for the WebUI handler.
- Streaming
State - Borrowed or owned JSON state supplied to a streaming step.
Constants§
- MAX_
BOUNDARY_ OCCURRENCES - Maximum runtime boundary occurrences in one response.
- MAX_
CONTINUATION_ DEPTH - Maximum continuation frames retained by one response.
- MAX_
KEYED_ INSTANCES - Maximum keyed runtime occurrences tracked for uniqueness.
- MAX_
SPAN_ NESTING - Maximum nested unfinished component spans.
- STATE_
INJECT_ KEY - Reserved top-level state key carrying host-supplied boundary HTML.
Traits§
- Flush
Writer - A response writer that can hand buffered bytes to its transport immediately.
- Response
Writer - Interface for writing rendered output
Functions§
- encode_
safe - Minimal HTML escaper for the 6 XSS-critical characters
(
& < > " ' /). ReturnsCow::Borrowedwhen no escaping is needed (zero allocation on the happy path),Cow::Ownedwhen any character had to be replaced.