Expand description
Script integration for Blitz.
This crate defines the contract for script-capable document backends and
shared facilities used by those backends. A backend implements
ScriptDocumentBackend to construct a document from HTML and execute its
scripts. The document participates in Blitz through the
Document interface.
Runtime-specific execution stays in the backend implementation. This crate provides a common document wrapper and shared diagnostics, fetching, job budgets, and script statistics.
Re-exports§
pub use native_document::BoundScriptDocument;pub use native_document::DocumentHostExtension;pub use native_document::DocumentPollHook;pub use native_document::NativeDocumentRuntime;pub use native_document::TypedNativeGuest;pub use runtime_driver::RuntimeDriver;
Modules§
- engine
- Execution control seam for script backends.
- native
- Bounded Rust script guest operating directly on a borrowed Blitz document.
- native_
document - native_
host - Engine-neutral contracts for native guest values and retained callbacks.
- runtime_
driver - Typed runtime driver for a document bound to a native guest and host.
- script_
stats - What the JavaScript side costs, per frame.
Structs§
- Application
Document - A statically dispatched document wrapper with the backend’s layout and ownership.
- Default
Script Fetcher - The default
ScriptFetcher: supportsfile:anddata:URLs. - Diagnostic
Batch - Diagnostic
Entry - Diagnostic
Stream Batch
Enums§
- Fetch
Error - Script
Kind - The supported executable script forms.
Traits§
- Native
Host Document Backend - Opt-in support for attaching an engine-native host to a script document.
- Script
Document Backend - A script-capable document backend constructible from HTML.
- Script
Fetcher - Trait for synchronously fetching external script sources.
Functions§
- external_
script_ urls - Discover external executable sources using the same admission rules as
document execution. Parser-inert scripts and scripts inside template
contents are excluded. Import maps are inline configuration, not external
executable sources, so their
srcattributes are not returned.