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.
Source§fn push_scope(&mut self)
fn push_scope(&mut self)
Enter a new scope (component or for-loop item boundary).
Typically resets per-scope counters.
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<()>
Called before rendering a signal binding.
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<()>
Called after rendering a signal binding.
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<()>
Called before rendering a for-loop block.
Defaults to
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<()>
Called after rendering a for-loop block.
Defaults to
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<()>
Called before rendering an if-condition block.
Defaults to
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<()>
Called after rendering an if-condition block.
Defaults to
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<()>
Called before rendering a repeat item in a for loop.
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<()>
Called after rendering a repeat item.
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<()>
Called when parser-produced element metadata is encountered.
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<()>
Called when emitting a matched route component’s opening tag.
Plugins can write framework-specific attributes before the closing
>.
The default is a no-op.Auto Trait Implementations§
impl Freeze for WebUIHydrationPlugin
impl RefUnwindSafe for WebUIHydrationPlugin
impl Send for WebUIHydrationPlugin
impl Sync for WebUIHydrationPlugin
impl Unpin for WebUIHydrationPlugin
impl UnsafeUnpin for WebUIHydrationPlugin
impl UnwindSafe for WebUIHydrationPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more