Skip to main content

Crate webui_desktop

Crate webui_desktop 

Source
Expand description

Native desktop SDK for WebUI applications.

Bundle loading, rendering, and frame configuration are available without native dependencies. Enable application-ipc for application IPC, native for the platform webview, source for development compilation, and cli for the webui-desktop tooling binary. Enable packaging to lay out an already-compiled host without source compilation. Enable verified-update for host-only, staged-file byte integrity checks. Enable startup-failure for an explicit host-only pre-frame error alert.

Structs§

ApiContext
Context passed to Rust custom-protocol API handlers.
ApiRouteRegistry
Registry of Rust custom-protocol API handlers.
BundleAsset
One asset included in a desktop bundle.
BundleIntegrity
Integrity metadata for immutable bundle contents.
DesktopApp
Entry point for constructing Rust-first desktop apps.
DesktopAppBuilder
Builder for Rust-first WebUI desktop hosts.
DesktopBundleConfig
Bundle-backed desktop runtime configuration.
DesktopBundleManifest
Manifest generated by webui desktop build and consumed by packaging.
DesktopFrame
Cross-platform desktop frame owned by a native shell backend.
DesktopFrameCapabilities
Cross-platform shell capabilities supported by the active backend.
DesktopMenu
Native menu descriptor.
DesktopMenuItem
Native menu item descriptor.
DesktopProtocolRequest
Runtime-neutral representation of a custom-protocol request.
DesktopProtocolResponse
Runtime-neutral representation of a custom-protocol response.
DesktopResponseBody
Owned response bytes and any resource reservation backing their lifetime.
DesktopResponseFile
A file response bounded to the length observed when it was opened. Growth is ignored; premature EOF is an explicit I/O error.
DesktopResponseLease
Opaque response-lifetime reservation released when the native body is freed.
DesktopRuntime
Runtime state shared by a desktop webview custom-protocol handler.
DesktopShellConfig
Runtime-neutral shell extension points for native desktop hosts.
DisplayBounds
Available display work area used to reject stale off-screen state.
EventRegistry
Thread-safe registration and dispatch container for lifecycle callbacks.
EventSubscription
Removes a subscribed lifecycle callback when dropped.
Rgba
An RGBA color used for the native and document window background.
RouteContext
Context passed to Rust route state providers.
RouteStateRegistry
Registry of Rust route state providers.
TrayConfig
Tray icon configuration.
WindowHandle
Sendable handle that queues commands and wakes the native UI loop.
WindowId
Stable identity for a desktop window.
WindowInsets
Safe-area insets reserved for native window controls.
WindowOptions
Cross-platform desktop window configuration stored in a bundle manifest.
WindowState
Persisted window geometry supplied to and consumed by native backends.
WindowStateStore
Bounded JSON state store in the app-data directory.

Enums§

CaptionButtonSize
Size of native Windows caption buttons in an application-drawn titlebar.
DesktopError
Errors produced by the runtime-neutral WebUI desktop layer.
DesktopEvent
A native lifecycle event delivered on the backend UI thread.
DesktopHostMessage
Strictly bounded host message sent from injected web content.
DesktopHostMessageError
Host-message parsing error.
DesktopHttpMethod
HTTP method for a desktop custom-protocol request.
DesktopPackageTarget
Native package target supported by webui desktop package.
DesktopPlatform
Native platform used to calculate titlebar safe areas.
DesktopResponseContent
Owned protocol content. Files retain an open handle and a fixed delivery length; native adapters must not reopen their paths or eagerly buffer them.
EventJavascriptError
Event JavaScript serialization error.
EventRegistrationError
Lifecycle callback registration error.
EventResponse
Response returned by a lifecycle handler.
RgbaParseError
Error returned when a manifest color is malformed.
TitlebarStyle
Native titlebar presentation requested by a window.
WebsiteDataError
Failure to establish an app-owned persistent browser-data boundary.
WindowCommand
A command queued for execution on the native UI thread.
WindowCommandError
Command queue error.
WindowCssNonceError
Error when a host-supplied CSP nonce cannot be placed in a style attribute.
WindowEffect
Platform visual effect requested by a window.
WindowStateError
Persistence error.

Constants§

DEFAULT_MAX_ASSET_BYTES
Default maximum file length delivered by a custom-protocol response.
DEFAULT_MAX_REQUEST_BYTES
Maximum ordinary native API request body size. Typed IPC has its own limits.
DRAG_REGION_SCRIPT
Shared script for [webui-drag] and [webui-no-drag] regions. Backends expose window.webuiHostPostMessage. Script injected by every backend to translate webui-drag regions into host messages.
MAX_EVENT_HANDLERS
Maximum number of persistent and subscribed lifecycle callbacks.
MAX_HOST_MESSAGE_BYTES
Maximum untrusted script-message payload size.
MAX_QUEUED_WINDOW_COMMANDS
Maximum number of commands buffered for the native UI thread before WindowHandle::send reports back-pressure instead of growing without bound.
MAX_QUEUED_WINDOW_TITLE_BYTES
Maximum aggregate UTF-8 title bytes buffered for the native UI thread.
MAX_WINDOW_TITLE_BYTES
Maximum UTF-8 bytes accepted in one queued window title.

Traits§

DesktopFrameBackend
Native desktop frame backend contract.

Functions§

apply_window_css
Splice a precomputed window CSS block into rendered HTML in one linear scan.
find_packaged_resources_dir
Return the packaged bundle resource directory when the executable is running from a desktop package layout.
is_allowed_navigation_url
Return whether url may be navigated to for an app served from origin.
run_frame_with
Validate and run a frame with a caller-supplied backend.
validate_frame_capabilities
Validate requested window and shell features before the native shell starts.
window_css_block
Build the constant <style> block carrying window CSS custom properties.
window_css_block_with_nonce
Build a trusted window style block for a response with nonce-only style-src.

Type Aliases§

EventHandler
UI-thread lifecycle callback. Handlers must not block the UI thread.
Result
Result type used by the WebUI desktop runtime.