pub struct Element {
pub name: String,
pub attrs: Vec<(String, String)>,
pub children: Vec<Node>,
}Expand description
An XML element: local name, attributes and children.
Fields§
§name: String§attrs: Vec<(String, String)>§children: Vec<Node>Implementations§
Source§impl Element
impl Element
Sourcepub fn attr(&self, name: &str) -> Option<&str>
pub fn attr(&self, name: &str) -> Option<&str>
Value of an attribute, matched on its local name.
Sourcepub fn attr_number(&self, name: &str) -> Option<i64>
pub fn attr_number(&self, name: &str) -> Option<i64>
An attribute parsed as a number.
Sourcepub fn elements(&self) -> impl Iterator<Item = &Element>
pub fn elements(&self) -> impl Iterator<Item = &Element>
Direct child elements, in document order.
Sourcepub fn path<'a, I>(&self, names: I) -> Option<&Element>where
I: IntoIterator<Item = &'a str>,
pub fn path<'a, I>(&self, names: I) -> Option<&Element>where
I: IntoIterator<Item = &'a str>,
Follow a chain of direct children: element.path(["pPr", "pStyle"]).
Sourcepub fn find(&self, name: &str) -> Option<&Element>
pub fn find(&self, name: &str) -> Option<&Element>
First descendant with this name, depth first.
Trait Implementations§
impl StructuralPartialEq for Element
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnsafeUnpin for Element
impl UnwindSafe for Element
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