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§

server
High-level server helper for custom Rust servers using webui-router.
streaming
Streaming ResponseWriter helpers for actix-web (or any) HTTP host.

Structs§

BuildOptions
Options for building a WebUI application.
BuildResult
Result of a successful build.
BuildStats
Statistics about a completed build.
CompiledRouteCache
Cache of pre-compiled route template patterns.
ComponentTemplateArtifact
Client template payload generated by a parser plugin for one component.
Diagnostic
A build-time template-authoring diagnostic.
ParserOptions
Build/output options that affect parser-generated component templates.
ProtocolIndex
Pre-computed index for a protocol, caching expensive lookups.
RenderOptions
Options controlling how the handler renders a protocol.
WebUIHandler
The main WebUI handler that processes protocols and renders them.

Enums§

CssStrategy
Strategy for how component CSS is delivered in rendered output.
DomStrategy
Strategy for how component DOM is structured.
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.
WebUIError
Errors that can occur during WebUI build, render, or inspection operations.

Constants§

DEFAULT_CSS_FILE_NAME_TEMPLATE
Default Link-mode CSS filename template.

Traits§

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.
get_needed_components_for_request
Walk the protocol from the persistent entry_id and return the component templates needed for the current request_path.
inspect
Inspect a compiled WebUI protocol file and return its JSON representation.
inspect_bytes
Inspect raw protocol bytes and return their JSON representation.
parse_inventory
Parse a hex-encoded inventory string into bytes.

Type Aliases§

HandlerResult
WebUIProtocol