pub struct Element {
pub tag: Cow<'static, str>,
pub attrs: Vec<Attr>,
pub children: Vec<Node>,
pub void: bool,
}Expand description
An HTML element.
Fields§
§tag: Cow<'static, str>§attrs: Vec<Attr>§children: Vec<Node>§void: boolImplementations§
Source§impl Element
impl Element
Sourcepub fn custom(tag: impl Into<String>) -> Element
pub fn custom(tag: impl Into<String>) -> Element
An element with a runtime tag name. Invalid names render as <div>
with a data-invalid-tag attribute rather than producing broken HTML.
Sourcepub fn set_attr(&mut self, attr: Attr)
pub fn set_attr(&mut self, attr: Attr)
Set or merge an attribute. class values are appended; other
attributes are replaced.
pub fn attr(&self, name: &str) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Element
impl !Sync for Element
impl !UnwindSafe for Element
impl Forget for Element
impl Freeze for Element
impl Move for Element
impl Send for Element
impl Unpin for Element
impl UnsafeUnpin 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