pub struct XmlElement { /* private fields */ }Expand description
An XML element with a qualified name and attributes.
Implementations§
Source§impl XmlElement
impl XmlElement
Sourcepub fn new(name: String, attributes: HashMap<String, String>) -> Self
pub fn new(name: String, attributes: HashMap<String, String>) -> Self
Creates a new XML element with the given name and attributes.
Sourcepub fn rehash(&mut self)
pub fn rehash(&mut self)
Recalculates the hash values and info size.
This should be called after modifying the name or attributes.
Sourcepub fn set_qname(&mut self, name: String)
pub fn set_qname(&mut self, name: String)
Sets the qualified name of the element.
Note: This does not automatically rehash. Call rehash() after
modifying if hash values are needed.
Sourcepub fn attributes(&self) -> &HashMap<String, String>
pub fn attributes(&self) -> &HashMap<String, String>
Returns the attributes.
Sourcepub fn attributes_mut(&mut self) -> &mut HashMap<String, String>
pub fn attributes_mut(&mut self) -> &mut HashMap<String, String>
Returns a mutable reference to the attributes.
Note: This does not automatically rehash. Call rehash() after
modifying if hash values are needed.
Sourcepub fn set_attributes(&mut self, attributes: HashMap<String, String>)
pub fn set_attributes(&mut self, attributes: HashMap<String, String>)
Sets the attributes.
Note: This does not automatically rehash. Call rehash() after
modifying if hash values are needed.
Sourcepub fn content_equals(&self, other: &XmlElement) -> bool
pub fn content_equals(&self, other: &XmlElement) -> bool
Tests content equality using hash comparison.
Sourcepub fn content_hash(&self) -> i32
pub fn content_hash(&self) -> i32
Returns a 32-bit hash code for this element.
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
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