pub struct WebUIHydrationPlugin { /* private fields */ }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: &[String],
nonce: Option<&str>,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn emit_templates( &self, protocol: &WebUIProtocol, components: &[String], nonce: Option<&str>, writer: &mut dyn ResponseWriter, ) -> Result<()>
Emit legacy non-split WebUI component templates inside a single
<script> tag for fallback paths.
NOTE: When collect_template_payloads returns Some(...), lib.rs
emits template metadata in an application/json block and this method
is not called. It remains for non-WebUI plugin fallback paths.
Source§fn collect_template_payloads<'a>(
&self,
protocol: &'a WebUIProtocol,
components: &[String],
) -> Option<Vec<WebUiTemplatePayload<'a>>>
fn collect_template_payloads<'a>( &self, protocol: &'a WebUIProtocol, components: &[String], ) -> Option<Vec<WebUiTemplatePayload<'a>>>
Collect split WebUI template payloads for SSR bootstrap emission.
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,
raw: bool,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_binding_start( &mut self, _name: &str, raw: bool, writer: &mut dyn ResponseWriter, ) -> Result<()>
Called before rendering a signal binding. Read more
Source§fn on_binding_end(
&mut self,
_name: &str,
raw: bool,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn on_binding_end( &mut self, _name: &str, raw: bool, writer: &mut dyn ResponseWriter, ) -> Result<()>
Called after rendering a signal binding. Read more
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 emit_templates_slice(
&self,
protocol: &WebUIProtocol,
tags: &[&str],
nonce: Option<&str>,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn emit_templates_slice( &self, protocol: &WebUIProtocol, tags: &[&str], nonce: Option<&str>, writer: &mut dyn ResponseWriter, ) -> Result<()>
Slice-based counterpart to
HandlerPlugin::emit_templates. Read moreSource§fn collect_template_payloads_slice<'a>(
&self,
protocol: &'a WebUIProtocol,
tags: &[&str],
) -> Option<Vec<WebUiTemplatePayload<'a>>>
fn collect_template_payloads_slice<'a>( &self, protocol: &'a WebUIProtocol, tags: &[&str], ) -> Option<Vec<WebUiTemplatePayload<'a>>>
Slice-based counterpart to
HandlerPlugin::collect_template_payloads. Read moreSource§fn emit_bootstrap_extension(
&self,
context: BootstrapExtensionContext<'_>,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn emit_bootstrap_extension( &self, context: BootstrapExtensionContext<'_>, writer: &mut dyn ResponseWriter, ) -> Result<()>
Emit plugin-specific executable SSR bootstrap code, if needed. Read more
Source§fn emit_bootstrap_extension_payloads(
&self,
payloads: &[WebUiTemplatePayload<'_>],
nonce: Option<&str>,
writer: &mut dyn ResponseWriter,
) -> Result<()>
fn emit_bootstrap_extension_payloads( &self, payloads: &[WebUiTemplatePayload<'_>], nonce: Option<&str>, writer: &mut dyn ResponseWriter, ) -> Result<()>
Emit plugin-specific executable SSR bootstrap code for the streaming
path, given only the already-collected template payloads. Read more
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