Skip to main content

Crate webui

Crate webui 

Source
Expand description

Programmatic API for the WebUI build-time rendering framework.

This crate provides the core build, render, and inspection APIs that power the webui CLI, Node.js bindings, and WASM module.

§Example

use webui::{build, BuildOptions};
use std::path::PathBuf;

let result = build(BuildOptions {
    app_dir: PathBuf::from("./src"),
    ..BuildOptions::default()
}).unwrap();

println!("Built {} fragments in {:?}", result.stats.fragment_count, result.stats.duration);

Modules§

component_asset_output
Transactional publication of generated component ESM inputs.
server
High-level server helper for custom Rust servers using webui-router.
streaming
Streaming ResponseWriter helpers for actix-web (or any) HTTP host.

Structs§

AssetFileNameTemplate
Validated filename template for emitted build assets.
AssetFileNameTemplateError
Error returned when an asset filename template is invalid.
BoundaryDescriptor
Runtime occurrence returned when traversal suspends.
BoundaryInstanceId
Response-local runtime boundary occurrence identity.
BuildOptions
Options for building a WebUI application.
BuildResult
Result of a successful build.
BuildStats
Statistics about a completed build.
ComponentAssetFile
A generated component or root ESM input.
ComponentAssetGraph
Rendered component asset graph.
ComponentTemplateArtifact
Client template payload generated by a parser plugin for one component.
CssFallbackChain
A CSS var() fallback chain that needs theme or local CSS coverage.
CssTokenAnalysis
CSS token analysis produced from the parsed template/component graph.
Diagnostic
A build-time template-authoring diagnostic.
ParserOptions
Build/output options that affect parser-generated component templates.
PreparedProjectionManifests
Projection metadata validated once for reuse across many protocol builds.
Protocol
A decoded protocol with reusable deterministic indices.
RenderOptions
Options controlling how the handler renders a protocol.
SessionOptions
Owned per-response configuration.
SpanInstanceId
Response-local generated component span identity.
StreamStatus
Borrowed-writer result of one semantic streaming step.
StreamStep
Bytes and continuation state returned by one owned semantic step.
StreamingResponse
A progressive response that writes directly through a FlushWriter.
StreamingSession
A progressive response owned independently of any Rust borrow.
TokenFile
Loaded token themes — maps theme name → (token name → CSS value).
WebUIHandler
The main WebUI handler that processes protocols and renders them.

Enums§

BoundaryKey
Valid evaluated key for a repeated boundary declaration.
BoundaryMode
Whether a committed occurrence may receive later state updates.
CssStrategy
Strategy for how component CSS is delivered in rendered output.
DomStrategy
Default DOM strategy for components without an authored declarative Shadow root.
HandlerError
Error types for the WebUI handler.
LegalComments
Strategy for preserving legal comments in generated output.
ParserError
Error type for WebUI parser.
Plugin
Framework plugin to load for build-time and render-time processing.
ProjectionManifestSource
One projection manifest supplied to a build.
Severity
Severity of a Diagnostic.
StateSurface
State surface a component consumes through one hydration channel.
StreamingState
Borrowed or owned JSON state supplied to a streaming step.
WebUIError
Errors that can occur during WebUI build, render, or inspection operations.

Constants§

DEFAULT_ASSET_FILE_NAME_TEMPLATE
Default build-asset filename template.
DEFAULT_CSS_FILE_NAME_TEMPLATE
Default Link-mode CSS filename template.

Traits§

FlushWriter
A response writer that can hand buffered bytes to its transport immediately.
HandlerPlugin
A handler plugin that can inject additional content during rendering.
ResponseWriter
Interface for writing rendered output

Functions§

build
Build a WebUI application from an app directory.
build_to_disk
Build a WebUI application and write output files to disk.
encode_inventory
Encode an inventory bitfield as a hex string.
get_needed_components
Walk the protocol fragment graph from entry_id and return the names of all components the route needs that are NOT in the client’s inventory.
inspect
Inspect a compiled WebUI protocol file and return its JSON representation.
inspect_bytes
Inspect raw protocol bytes and return their JSON representation.
load_token_file
Load a multi-theme token file.
parse_inventory
Parse a hex-encoded inventory string into bytes.
prepare_projection_manifests
Validate and merge projection sources once for repeated builds.
render_component_assets
Render a static component asset graph.
resolve_theme_path
Resolve a --theme value to a file path on disk.

Type Aliases§

HandlerResult
WebUIProtocol