pub struct WebUIHydrationPlugin;Expand description
WebUI handler plugin that emits hydration markers.
Emits lightweight HTML comment markers around structural boundaries (for-loops and if-conditions) so the client can hydrate in-place without reparenting DOM nodes.
Implementations§
Trait Implementations§
Source§impl Default for WebUIHydrationPlugin
impl Default for WebUIHydrationPlugin
Source§impl HandlerPlugin for WebUIHydrationPlugin
impl HandlerPlugin for WebUIHydrationPlugin
Source§fn emit_templates(
&self,
protocol: &WebUIProtocol,
components: &HashSet<String>,
nonce: Option<&str>,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn emit_templates( &self, protocol: &WebUIProtocol, components: &HashSet<String>, nonce: Option<&str>, writer: &mut dyn ResponseWriter, ) -> Result<()>
Emit all WebUI component templates inside a single <script> tag
for SSR. Templates are raw JS IIFE strings (no <script> wrapper)
stored in the protocol — the <script> tag is only added here for
the SSR HTML output. Partial SPA responses send the raw JS directly
and the router evaluates it client-side.
NOTE: When collect_template_js returns Some(...), lib.rs merges
the templates into the consolidated window.__webui script block and
this method is not called. It remains as a fallback for
non-consolidated code paths.
Source§fn collect_template_js(
&self,
protocol: &WebUIProtocol,
components: &HashSet<String>,
) -> Option<Vec<String>>
fn collect_template_js( &self, protocol: &WebUIProtocol, components: &HashSet<String>, ) -> Option<Vec<String>>
Collect raw JS template IIFE strings for embedding in the consolidated
window.__webui script block. Returns Some(vec) with non-empty
template sources, or None if there are no templates to emit.
Source§fn push_scope(&mut self)
fn push_scope(&mut self)
Source§fn on_binding_start(
&mut self,
_name: &str,
_writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_binding_start( &mut self, _name: &str, _writer: &mut dyn ResponseWriter, ) -> Result<()>
Source§fn on_binding_end(
&mut self,
_name: &str,
_writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_binding_end( &mut self, _name: &str, _writer: &mut dyn ResponseWriter, ) -> Result<()>
Source§fn on_for_start(
&mut self,
_name: &str,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_for_start( &mut self, _name: &str, writer: &mut dyn ResponseWriter, ) -> Result<()>
on_binding_start.Source§fn on_for_end(
&mut self,
_name: &str,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_for_end( &mut self, _name: &str, writer: &mut dyn ResponseWriter, ) -> Result<()>
on_binding_end.Source§fn on_if_start(
&mut self,
_name: &str,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_if_start( &mut self, _name: &str, writer: &mut dyn ResponseWriter, ) -> Result<()>
on_binding_start.Source§fn on_if_end(
&mut self,
_name: &str,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_if_end( &mut self, _name: &str, writer: &mut dyn ResponseWriter, ) -> Result<()>
on_binding_end.Source§fn on_repeat_item_start(
&mut self,
_index: usize,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_repeat_item_start( &mut self, _index: usize, writer: &mut dyn ResponseWriter, ) -> Result<()>
Source§fn on_repeat_item_end(
&mut self,
_index: usize,
_writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_repeat_item_end( &mut self, _index: usize, _writer: &mut dyn ResponseWriter, ) -> Result<()>
Source§fn on_element_data(
&mut self,
_data: &[u8],
_writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_element_data( &mut self, _data: &[u8], _writer: &mut dyn ResponseWriter, ) -> Result<()>
Source§fn write_route_component_state(
&self,
_state: &Value,
_writer: &mut dyn ResponseWriter,
) -> Result<()>
fn write_route_component_state( &self, _state: &Value, _writer: &mut dyn ResponseWriter, ) -> Result<()>
>.
The default is a no-op.