pub trait Element<T: OutputType + Send>: Node<T> {
// Required methods
fn name() -> &'static str;
fn attribute_names() -> &'static [&'static str];
fn required_children() -> &'static [&'static str];
fn attributes(&self) -> Vec<(&'static str, String)>;
}Expand description
Trait for querying a typed HTML element.
All HTML elements implement this.
Required Methods§
sourcefn attribute_names() -> &'static [&'static str]
fn attribute_names() -> &'static [&'static str]
Get a list of the attribute names for this element.
This includes only the typed attributes, not any data- attributes
defined on this particular element instance.
This is probably not useful unless you’re the html! macro.
sourcefn required_children() -> &'static [&'static str]
fn required_children() -> &'static [&'static str]
Get a list of the element names of required children for this element.
This is probably not useful unless you’re the html! macro.
sourcefn attributes(&self) -> Vec<(&'static str, String)>
fn attributes(&self) -> Vec<(&'static str, String)>
Get a list of the defined attribute pairs for this element.
This will convert attribute values into strings and return a vector of key/value pairs.