Struct html_node_core::Element
source · pub struct Element {
pub name: String,
pub attributes: Vec<(String, Option<String>)>,
pub children: Option<Vec<Node>>,
}
Expand description
An element.
<div class="container">
I'm in an element!
</div>
Fields§
§name: String
The name of the element.
<name>
attributes: Vec<(String, Option<String>)>
The attributes of the element.
<div attribute="value">
children: Option<Vec<Node>>
The children of the element.
<div>
<!-- I'm a child! -->
<child>I'm another child!</child>
</div>
Implementations§
source§impl Element
impl Element
sourcepub fn from_typed<E: TypedElement>(
element: E,
children: Option<Vec<Node>>
) -> Self
Available on crate feature typed
only.
pub fn from_typed<E: TypedElement>( element: E, children: Option<Vec<Node>> ) -> Self
typed
only.Create a new Element
from a TypedElement
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Element
impl<'de> Deserialize<'de> for Element
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Element> for Element
impl PartialEq<Element> for Element
impl Eq for Element
impl StructuralEq for Element
impl StructuralPartialEq for Element
Auto Trait Implementations§
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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