Struct html_ast::HtmlElement
source · pub struct HtmlElement { /* private fields */ }
Expand description
An HTML element.
Implementations§
source§impl HtmlElement
impl HtmlElement
pub fn new<S: ToString>(tag: S) -> Self
pub fn set_tag<S: ToString>(&mut self, tag: S)
pub fn get_id(&self) -> &str
pub fn set_id<S: ToString>(&mut self, id: S)
pub fn with_id<S: ToString>(self, id: S) -> Self
pub fn get_classes(&self) -> &[String]
pub fn mut_classes(&mut self) -> &mut Vec<String>
pub fn with_class<S: ToString>(self, class: S) -> Self
pub fn with_attribute<K: ToString, V: ToString>(self, key: K, value: V) -> Self
pub fn get_children(&self) -> &[HtmlNode]
pub fn mut_children(&mut self) -> &mut Vec<HtmlNode>
pub fn push_child<H: Into<HtmlNode>>(&mut self, child: H)
pub fn with_child<H: Into<HtmlNode>>(self, child: H) -> Self
pub fn with_text<S: ToString>(self, text: S) -> Self
Trait Implementations§
source§impl Clone for HtmlElement
impl Clone for HtmlElement
source§fn clone(&self) -> HtmlElement
fn clone(&self) -> HtmlElement
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for HtmlElement
impl Default for HtmlElement
source§impl Display for HtmlElement
impl Display for HtmlElement
source§impl From<HtmlElement> for HtmlNode
impl From<HtmlElement> for HtmlNode
source§fn from(value: HtmlElement) -> Self
fn from(value: HtmlElement) -> Self
Converts to this type from the input type.
source§impl PartialEq<HtmlElement> for HtmlElement
impl PartialEq<HtmlElement> for HtmlElement
source§fn eq(&self, other: &HtmlElement) -> bool
fn eq(&self, other: &HtmlElement) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for HtmlElement
impl StructuralEq for HtmlElement
impl StructuralPartialEq for HtmlElement
Auto Trait Implementations§
impl RefUnwindSafe for HtmlElement
impl Send for HtmlElement
impl Sync for HtmlElement
impl Unpin for HtmlElement
impl UnwindSafe for HtmlElement
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