Skip to main content

WebUIHydrationPlugin

Struct WebUIHydrationPlugin 

Source
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§

Source§

impl WebUIHydrationPlugin

Source

pub fn new() -> Self

Create a new WebUI handler plugin.

Trait Implementations§

Source§

impl Default for WebUIHydrationPlugin

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HandlerPlugin for WebUIHydrationPlugin

Source§

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>>>

Collect split WebUI template payloads for SSR bootstrap emission.

Source§

fn push_scope(&mut self)

Enter a new scope (component or for-loop item boundary). Typically resets per-scope counters.
Source§

fn pop_scope(&mut self)

Exit the current scope, restoring the parent scope state.
Source§

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<()>

Called after rendering a signal binding. Read more
Source§

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<()>

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<()>

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<()>

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<()>

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<()>

Called after rendering a repeat item.
Source§

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<()>

Slice-based counterpart to HandlerPlugin::emit_templates. Read more
Source§

fn collect_template_payloads_slice<'a>( &self, protocol: &'a WebUIProtocol, tags: &[&str], ) -> Option<Vec<WebUiTemplatePayload<'a>>>

Source§

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<()>

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<()>

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.