pub struct WebUIParserPlugin { /* private fields */ }Expand description
WebUI Framework parser plugin.
Intercepts @event attributes and component registrations during parsing,
then compiles each component’s HTML template into JSON metadata and JS closures.
§Event tracking
Event indices are assigned globally across all elements in a component.
element_events counts events on the current element (reset per element),
while next_event_idx is a monotonically increasing global counter.
This preserves event order in the emitted metadata while letting SSR HTML
mark one element with a single data-ev="COUNT" attribute.
Implementations§
Trait Implementations§
Source§impl Default for WebUIParserPlugin
impl Default for WebUIParserPlugin
Source§impl ParserPlugin for WebUIParserPlugin
impl ParserPlugin for WebUIParserPlugin
Source§fn start_fragment(&mut self, _fragment_id: &str)
fn start_fragment(&mut self, _fragment_id: &str)
Called before parsing begins for a fragment. Read more
Source§fn configure(&mut self, options: &ParserOptions)
fn configure(&mut self, options: &ParserOptions)
Called when parser output options change.
Source§fn classify_attribute(&mut self, attr_name: &str) -> AttributeAction
fn classify_attribute(&mut self, attr_name: &str) -> AttributeAction
Decide how a framework-owned attribute should be handled.
Source§fn register_component_template(
&mut self,
tag_name: &str,
component: &Component,
processed_template: &str,
) -> Result<()>
fn register_component_template( &mut self, tag_name: &str, component: &Component, processed_template: &str, ) -> Result<()>
Called with the plugin-facing component template for the active CSS/DOM
strategies. Authored root
<template> attributes are preserved here;
the SSR/internal parse view may strip runtime-only attributes. Read moreSource§fn finish_element(&mut self, binding_attribute_count: u32) -> Option<Vec<u8>>
fn finish_element(&mut self, binding_attribute_count: u32) -> Option<Vec<u8>>
Called after all attributes on an element have been processed.
binding_attribute_count is the number of dynamic attribute bindings found.
Returns optional opaque bytes to emit as a Plugin protocol fragment.Source§fn into_artifacts(self: Box<Self>) -> Result<ParserPluginArtifacts>
fn into_artifacts(self: Box<Self>) -> Result<ParserPluginArtifacts>
Consume the plugin and return any build artifacts it captured. Read more
Auto Trait Implementations§
impl !Freeze for WebUIParserPlugin
impl !RefUnwindSafe for WebUIParserPlugin
impl !Sync for WebUIParserPlugin
impl Send for WebUIParserPlugin
impl Unpin for WebUIParserPlugin
impl UnsafeUnpin for WebUIParserPlugin
impl UnwindSafe for WebUIParserPlugin
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