Trait typed_html::dom::Element

source ·
pub trait Element<T: OutputType>: Node<T> {
    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

Get the name of the element.

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.

Get a list of the element names of required children for this element.

This is probably not useful unless you’re the html! macro.

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.

Implementors