Struct simple_xml_builder::XMLElement
source · pub struct XMLElement { /* private fields */ }
Expand description
Represents an XML element
Implementations§
source§impl XMLElement
impl XMLElement
sourcepub fn new(name: &str) -> Self
pub fn new(name: &str) -> Self
Creates a new empty XML element using the given name for the tag.
sourcepub fn add_attribute(&mut self, name: &str, value: &str)
pub fn add_attribute(&mut self, name: &str, value: &str)
Adds an attribute to the XML element.
sourcepub fn add_child(&mut self, child: XMLElement)
pub fn add_child(&mut self, child: XMLElement)
Adds a child element to the XML element. The new child will be placed after previously added children.
This method may only be called on an element that has children or is empty.
Panics
Panics if the element contains text.
Trait Implementations§
source§impl Clone for XMLElement
impl Clone for XMLElement
source§fn clone(&self) -> XMLElement
fn clone(&self) -> XMLElement
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 Debug for XMLElement
impl Debug for XMLElement
source§impl Display for XMLElement
impl Display for XMLElement
source§impl PartialEq<XMLElement> for XMLElement
impl PartialEq<XMLElement> for XMLElement
source§fn eq(&self, other: &XMLElement) -> bool
fn eq(&self, other: &XMLElement) -> bool
impl Eq for XMLElement
impl StructuralEq for XMLElement
impl StructuralPartialEq for XMLElement
Auto Trait Implementations§
impl RefUnwindSafe for XMLElement
impl Send for XMLElement
impl Sync for XMLElement
impl Unpin for XMLElement
impl UnwindSafe for XMLElement
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.