pub struct XMLElement { /* private fields */ }
Expand description
Represents an XML element
Implementations§
Source§impl XMLElement
impl XMLElement
Sourcepub fn new(name: impl ToString) -> Self
pub fn new(name: impl ToString) -> Self
Creates a new empty XML element using the given name for the tag.
Sourcepub fn add_attribute(&mut self, name: impl ToString, value: impl ToString)
pub fn add_attribute(&mut self, name: impl ToString, value: impl ToString)
Adds an attribute to the XML element. The attribute value can take any
type which implements fmt::Display
.
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 duplicate 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 for XMLElement
impl PartialEq for XMLElement
impl Eq for XMLElement
impl StructuralPartialEq for XMLElement
Auto Trait Implementations§
impl Freeze for XMLElement
impl RefUnwindSafe for XMLElement
impl Send for XMLElement
impl Sync for XMLElement
impl Unpin for XMLElement
impl UnwindSafe for XMLElement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.