[][src]Struct html_types::node::Element

pub struct Element<'a, T> where
    T: ElementType
{ pub name: Tag<'a>, pub attributes: HashMap<Attribute<'a>, Option<Value>>, pub children: T, }

The html element type. This is the most common Note: if children is None, then it is handled as an empty element, this is different than having no children

Fields

name: Tag<'a>attributes: HashMap<Attribute<'a>, Option<Value>>children: T

Implementations

impl<'a> Element<'a, Vec<Node<'a>>>[src]

pub fn push<N>(&mut self, node: N) where
    N: Into<Node<'a>>, 
[src]

Pushes a child not into the element Note: you can also do this yourself, but this is nicer as it will coerce anything that can be a node into a node

impl<'a, T> Element<'a, T> where
    T: ElementType
[src]

pub fn create(name: Tag<'a>) -> Self[src]

Creates a typical element with children, from the provided tag name. This is the typical case

pub fn add_bool_attribute(&mut self, key: Attribute<'a>)[src]

pub fn add_attribute(&mut self, key: Attribute<'a>, value: Value)[src]

Trait Implementations

impl<'a, T: Clone> Clone for Element<'a, T> where
    T: ElementType
[src]

impl<'a> From<Element<'a, ()>> for Node<'a>[src]

impl<'a> From<Element<'a, Vec<Node<'a>>>> for Node<'a>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Element<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Element<'a, T> where
    T: Send

impl<'a, T> Sync for Element<'a, T> where
    T: Sync

impl<'a, T> Unpin for Element<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Element<'a, T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.