pub trait ControlScriptBackend: Document {
// Required methods
fn dispatch_dom_event(&mut self, event: DomEvent);
fn handle_pointer_move_to_node(
&mut self,
event: BlitzPointerEvent,
node: NodeId,
);
fn handle_ui_event_to_node(&mut self, event: UiEvent, node: NodeId);
// Provided method
fn script_metrics(&self) -> Option<ScriptMetrics> { ... }
}Expand description
A script-capable backend for the control protocol.
Implementations provide a blitz_dom::Document for protocol observation and
implement the event delivery that the document alone cannot perform. Event
methods must preserve target-directed delivery, bubbling, cancellation and
native default actions. Pointer movement must preserve hover event ordering.
Observation calls blitz_dom::Document::poll_for_settle with timers
disabled and a bounded budget. Action settlement uses bounded calls to
blitz_dom::Document::poll, preserving the backend’s normal timer policy.
Backends must report whether each poll leaves immediate work runnable.
Hosts implement this contract on their document owner or an adapter that
delegates Document and event delivery to the selected script backend.
Required Methods§
Sourcefn dispatch_dom_event(&mut self, event: DomEvent)
fn dispatch_dom_event(&mut self, event: DomEvent)
Dispatch a DOM event through the backend’s scripted event handling.
Sourcefn handle_pointer_move_to_node(
&mut self,
event: BlitzPointerEvent,
node: NodeId,
)
fn handle_pointer_move_to_node( &mut self, event: BlitzPointerEvent, node: NodeId, )
Deliver pointer movement to a target node, preserving hover event order.
Sourcefn handle_ui_event_to_node(&mut self, event: UiEvent, node: NodeId)
fn handle_ui_event_to_node(&mut self, event: UiEvent, node: NodeId)
Deliver a UI event to its target node with native defaults and bubbling.
Provided Methods§
Sourcefn script_metrics(&self) -> Option<ScriptMetrics>
fn script_metrics(&self) -> Option<ScriptMetrics>
Return script runtime metrics when the backend can provide them.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".