[−][src]Struct html_types::node::Element
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]
N: Into<Node<'a>>,
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]
T: ElementType,
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]
T: ElementType,
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,
T: RefUnwindSafe,
impl<'a, T> Send for Element<'a, T> where
T: Send,
T: Send,
impl<'a, T> Sync for Element<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for Element<'a, T> where
T: Unpin,
T: Unpin,
impl<'a, T> UnwindSafe for Element<'a, T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,