Trait html_node::typed::TypedElement
source · pub trait TypedElement: Default {
type Attributes: TypedAttributes;
const NAME: &'static str;
// Required methods
fn from_attributes(
attributes: Self::Attributes,
other_attributes: Vec<(String, Option<String>), Global>
) -> Self;
fn into_element(self, children: Option<Vec<Node, Global>>) -> Element;
// Provided method
fn into_node(self, children: Option<Vec<Node, Global>>) -> Node { ... }
}
Available on crate feature
typed
only.Expand description
A typed HTML element.
Required Associated Types§
sourcetype Attributes: TypedAttributes
type Attributes: TypedAttributes
The attributes of the element.
Required Associated Constants§
Required Methods§
sourcefn from_attributes(
attributes: Self::Attributes,
other_attributes: Vec<(String, Option<String>), Global>
) -> Self
fn from_attributes( attributes: Self::Attributes, other_attributes: Vec<(String, Option<String>), Global> ) -> Self
Create an element from its attributes.
Provided Methods§
sourcefn into_node(self, children: Option<Vec<Node, Global>>) -> Node
fn into_node(self, children: Option<Vec<Node, Global>>) -> Node
Convert the typed element into a Node
.
By default, this is equivalent to calling TypedElement::into_element
and then just wrapping it in a Node::Element
.