pub struct HtmlElement { /* private fields */ }
Expand description
An HTML element.
Implementations§
Source§impl HtmlElement
impl HtmlElement
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) -> &BTreeSet<String>
pub fn mut_classes(&mut self) -> &mut BTreeSet<String>
pub fn add_class<S: ToString>(&mut self, class: S)
pub fn with_class<S: ToString>(self, class: S) -> Self
pub fn get_attributes(&self) -> &BTreeMap<String, String>
pub fn mut_attributes(&mut self) -> &mut BTreeMap<String, String>
pub fn add_attribute<K: ToString, V: ToString>(&mut self, key: K, value: V)
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 add_child<H: Into<HtmlNode>>(&mut self, child: H)
pub fn with_child<H: Into<HtmlNode>>(self, child: H) -> Self
Sourcepub fn add_safe_text(&mut self, text: Cow<'static, str>)
pub fn add_safe_text(&mut self, text: Cow<'static, str>)
Add a section of HTML text that does not need to be transferred
Sourcepub fn add_text<S: AsRef<str>>(&mut self, text: S)
pub fn add_text<S: AsRef<str>>(&mut self, text: S)
Add a section of HTML text and make righteousness
pub fn with_safe_text(self, text: Cow<'static, str>) -> Self
pub fn with_text<S: AsRef<str>>(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 for HtmlElement
impl PartialEq for HtmlElement
impl Eq for HtmlElement
impl StructuralPartialEq for HtmlElement
Auto Trait Implementations§
impl Freeze for HtmlElement
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