pub struct Component {
pub tag_name: String,
pub html_content: String,
pub css_content: Option<String>,
pub css_definitions: Vec<String>,
pub css_fallback_chains: Vec<CssFallbackChain>,
pub is_client_owned: bool,
}Expand description
Represents a web component in the registry.
use webui_parser::Component;
let component = Component {
tag_name: "example-card".to_string(),
html_content: "<p>Example</p>".to_string(),
css_content: None,
css_definitions: Vec::new(),
css_fallback_chains: Vec::new(),
is_client_owned: false,
};
assert_eq!(component.tag_name, "example-card");Fields§
§tag_name: StringThe custom element tag name (e.g., “hello-world”)
html_content: StringThe HTML content of the component
css_content: Option<String>The CSS content of the component, if any
css_definitions: Vec<String>Unconditional :host/:root custom property defaults from this component’s CSS.
css_fallback_chains: Vec<CssFallbackChain>CSS var() fallback chains from this component’s CSS.
is_client_owned: boolWhether authored browser code owns this custom element tag.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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