Skip to main content

Crate blitz_script

Crate blitz_script 

Source
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§

ApplicationDocument
A statically dispatched document wrapper with the backend’s layout and ownership.
DefaultScriptFetcher
The default ScriptFetcher: supports file: and data: URLs.
DiagnosticBatch
DiagnosticEntry
DiagnosticStreamBatch

Enums§

FetchError
ScriptKind
The supported executable script forms.

Traits§

NativeHostDocumentBackend
Opt-in support for attaching an engine-native host to a script document.
ScriptDocumentBackend
A script-capable document backend constructible from HTML.
ScriptFetcher
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 src attributes are not returned.