pub struct XmlElement {
pub text: Option<String>,
pub tag: String,
pub attributes: HashMap<String, String>,
pub children: HashMap<String, Vec<XmlElement>>,
}Expand description
Full XML element, requires further type information to convert to a data type.
Fields§
§text: Option<String>XML Element body.
tag: StringTag name.
attributes: HashMap<String, String>Map of attribute names to values.
children: HashMap<String, Vec<XmlElement>>Map of child tag names to value.
Implementations§
Source§impl XmlElement
impl XmlElement
Sourcepub fn children_with_name<'a>(
&'a self,
name: &'a str,
) -> impl Iterator<Item = &'a XmlElement> + 'a
pub fn children_with_name<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a XmlElement> + 'a
Get all children of this node with the given name.
Sourcepub fn first_child_with_name<'a>(
&'a self,
name: &'a str,
) -> Option<&'a XmlElement>
pub fn first_child_with_name<'a>( &'a self, name: &'a str, ) -> Option<&'a XmlElement>
Get the first child with the given name.
Sourcepub fn child_content<'a>(&'a self, name: &'a str) -> Option<&'a str>
pub fn child_content<'a>(&'a self, name: &'a str) -> Option<&'a str>
Get the content of the first child with the given name.
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 UnsafeUnpin 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.