[][src]Struct dom_renderer::element::DomEmptyElem

pub struct DomEmptyElem {
    pub tag: &'static str,
    pub attributes: Vec<(&'static str, String)>,
}

DOM Empty Element

Example

use dom_renderer::*;
 
let expect = r#"<input type="text" name="user_name">"#;
 
let input = empty!("input";
    ("type", "text"),
    ("name", "user_name"),
);
assert_eq!(expect, input.render());
 
// the above macro is extrated as
let input = EmptyElement(DomEmptyElem::new(
    "input",
    vec![
        ("type", String::from("text")),
        ("name", String::from("user_name")),
    ]));
assert_eq!(expect, input.render());

Fields

tag: &'static strattributes: Vec<(&'static str, String)>

Implementations

impl DomEmptyElem[src]

pub fn new(tag: &'static str, attr: Vec<(&'static str, String)>) -> Self[src]

Trait Implementations

impl Clone for DomEmptyElem[src]

impl Debug for DomEmptyElem[src]

impl Render for DomEmptyElem[src]

Auto Trait Implementations

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.