pub struct HtmlParser { /* private fields */ }Expand description
Parser for WebUI directives.
Implementations§
Source§impl HtmlParser
impl HtmlParser
Sourcepub fn with_options(options: impl Into<ParserOptions>) -> Self
pub fn with_options(options: impl Into<ParserOptions>) -> Self
Create a new directive parser with explicit parser options.
Sourcepub fn with_plugin(plugin: Box<dyn ParserPlugin>) -> Self
pub fn with_plugin(plugin: Box<dyn ParserPlugin>) -> Self
Create a new parser with a plugin and default parser options.
Sourcepub fn with_plugin_options(
plugin: Box<dyn ParserPlugin>,
options: impl Into<ParserOptions>,
) -> Self
pub fn with_plugin_options( plugin: Box<dyn ParserPlugin>, options: impl Into<ParserOptions>, ) -> Self
Create a new parser with a plugin and explicit parser options.
Sourcepub fn component_registry_mut(&mut self) -> &mut ComponentRegistry
pub fn component_registry_mut(&mut self) -> &mut ComponentRegistry
Get a mutable reference to the component registry.
Sourcepub fn component_registry(&self) -> &ComponentRegistry
pub fn component_registry(&self) -> &ComponentRegistry
Get a shared reference to the component registry.
pub fn into_fragment_records(self) -> WebUIFragmentRecords
Sourcepub fn has_fragment(&self, fragment_id: &str) -> bool
pub fn has_fragment(&self, fragment_id: &str) -> bool
Check if a fragment ID has been parsed (exists in the fragment records).
Sourcepub fn take_plugin_artifacts(&mut self) -> Result<ParserPluginArtifacts>
pub fn take_plugin_artifacts(&mut self) -> Result<ParserPluginArtifacts>
Take any post-parse artifacts captured by the parser plugin.
§Errors
Returns ParserError::Template if a tracked component contains an
invalid @event handler or a non-braced w-ref binding.
Sourcepub fn take_tokens(&mut self) -> Vec<String>
pub fn take_tokens(&mut self) -> Vec<String>
Take the accumulated CSS tokens as a sorted, deduplicated Vec.
Tokens that are defined in inline <style> tags (e.g., in a
:root block) are excluded — only externally-referenced tokens
that the app does not already define are returned.
This consumes the internal token store. Call after parsing is complete.