Skip to main content

restore_host_bindings

Function restore_host_bindings 

Source
pub fn restore_host_bindings(prior: Vec<EventBinding>) -> Vec<u64>
Expand description

Carry prior bindings forward past a hot reload, and report the tokens that were dropped instead.

A prior binding is dropped when the reloaded script already bound the same node, event type, and phase; the new binding is the one that matches the new source. Every other prior binding is re-registered, so a handler bound from on_start (which the runtime fires once, at app construction) still fires after a reload. The returned tokens are the dropped ones, for the caller to purge from its own handler map.

Carried bindings go back in front of the new ones, preserving the order handlers ran in before the reload.