Skip to main content

FastHydrationPlugin

Struct FastHydrationPlugin 

Source
pub struct FastHydrationPlugin { /* private fields */ }
Expand description

FAST Hydration handler plugin.

Emits HTML comment markers around dynamic bindings so that FAST-HTML can re-hydrate server-rendered content on the client side.

The root scope is disabled (no markers) — hydration only activates in child scopes (components, for-loop items, if-condition bodies). This matches the C++ and JS prototype behavior.

Implementations§

Source§

impl FastHydrationPlugin

Source

pub fn new() -> Self

Create a new FAST hydration plugin. The initial root scope is disabled — markers only emitted in child scopes.

Trait Implementations§

Source§

impl Default for FastHydrationPlugin

Source§

fn default() -> Self

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

impl HandlerPlugin for FastHydrationPlugin

Source§

fn write_route_component_state( &self, state: &Value, writer: &mut dyn ResponseWriter, ) -> Result<()>

FAST emits scalar attributes + data-state JSON on route component elements. Components read these via @attr and prepare().

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

Called after rendering a signal binding.
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 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 emit_templates( &self, protocol: &WebUIProtocol, components: &HashSet<String>, _nonce: Option<&str>, writer: &mut dyn ResponseWriter, ) -> Result<()>

Emit component templates collected during SSR. The default emits each template as-is (suitable for FAST <f-template> tags). The WebUI plugin overrides this to wrap all raw JS IIFE templates in a single <script> tag.

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

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.