pub struct ComponentRegistry { /* private fields */ }Expand description
Registry of web components.
Implementations§
Source§impl ComponentRegistry
impl ComponentRegistry
Sourcepub fn register_from_paths<P: AsRef<Path>>(
&mut self,
directories: &[P],
) -> Result<&mut Self>
pub fn register_from_paths<P: AsRef<Path>>( &mut self, directories: &[P], ) -> Result<&mut Self>
Register multiple components from directories recursively.
Sourcepub fn register_component_from_paths<P: AsRef<Path>, Q: AsRef<Path>>(
&mut self,
html_path: P,
css_path: Option<Q>,
) -> Result<()>
pub fn register_component_from_paths<P: AsRef<Path>, Q: AsRef<Path>>( &mut self, html_path: P, css_path: Option<Q>, ) -> Result<()>
Register a web component from paths to HTML and CSS files.
Sourcepub fn register_component(
&mut self,
registration: ComponentRegistration<'_>,
) -> Result<()>
pub fn register_component( &mut self, registration: ComponentRegistration<'_>, ) -> Result<()>
Register a component directly from provided content strings.
Exact JavaScript state ownership is supplied later by a bundler projection manifest; the parser stores only whether this tag is client-owned.
Sourcepub fn contains(&self, tag_name: &str) -> bool
pub fn contains(&self, tag_name: &str) -> bool
Check if a tag name is registered as a component.
Sourcepub fn render_policy_css<'a>(
&self,
tag_names: impl IntoIterator<Item = &'a str>,
) -> String
pub fn render_policy_css<'a>( &self, tag_names: impl IntoIterator<Item = &'a str>, ) -> String
Build deterministic document-level CSS for the supplied component tags that opt into browser-managed lazy rendering.
Trait Implementations§
Source§impl Debug for ComponentRegistry
impl Debug for ComponentRegistry
Auto Trait Implementations§
impl Freeze for ComponentRegistry
impl RefUnwindSafe for ComponentRegistry
impl Send for ComponentRegistry
impl Sync for ComponentRegistry
impl Unpin for ComponentRegistry
impl UnsafeUnpin for ComponentRegistry
impl UnwindSafe for ComponentRegistry
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