pub struct FastParserPlugin { /* private fields */ }Expand description
FAST parser plugin.
Implements the ParserPlugin trait for the FAST framework:
- Filters FAST-specific runtime binding attributes (
@click,f-ref, etc.) - Tracks components encountered during parsing
- Generates
<f-template>wrappers with converted FAST syntax at body end - Emits binding attribute counts as
Pluginprotocol fragment data
Implementations§
Source§impl FastParserPlugin
impl FastParserPlugin
Sourcepub fn set_css_strategy(&mut self, strategy: CssStrategy)
pub fn set_css_strategy(&mut self, strategy: CssStrategy)
Set the CSS delivery strategy for generated f-templates.
Sourcepub fn take_component_templates(&self) -> Vec<(String, String)>
pub fn take_component_templates(&self) -> Vec<(String, String)>
Take the individual component f-template strings, keyed by tag name.
Each value is a complete <f-template name="tag-name">...</f-template> string
ready to be appended to a document. This is used by the JSON partial render
endpoint to send only the templates the client needs.
Trait Implementations§
Source§impl Default for FastParserPlugin
impl Default for FastParserPlugin
Source§impl ParserPlugin for FastParserPlugin
impl ParserPlugin for FastParserPlugin
Source§fn should_skip_attribute(&self, attr_name: &str) -> bool
fn should_skip_attribute(&self, attr_name: &str) -> bool
Return
true if this attribute should be skipped during parsing.
Framework-specific client-side bindings (e.g., @click, f-ref)
should be skipped since they are only meaningful at runtime.Source§fn on_parse_component(
&mut self,
tag_name: &str,
component: &Component,
) -> Result<()>
fn on_parse_component( &mut self, tag_name: &str, component: &Component, ) -> Result<()>
Called when a component element is encountered during parsing.
Use to track components for later template generation.
Source§fn on_element_parsed(&mut self, binding_attribute_count: u32) -> Option<Vec<u8>>
fn on_element_parsed(&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 on_body_end(&mut self) -> Option<String>
fn on_body_end(&mut self) -> Option<String>
Called when the
</body> closing tag is encountered.
Returns optional raw HTML content to inject before </body>.
FAST uses this for <f-template> wrappers.Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast to mutable
Any for plugin-specific access.Auto Trait Implementations§
impl Freeze for FastParserPlugin
impl RefUnwindSafe for FastParserPlugin
impl Send for FastParserPlugin
impl Sync for FastParserPlugin
impl Unpin for FastParserPlugin
impl UnsafeUnpin for FastParserPlugin
impl UnwindSafe for FastParserPlugin
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