pub trait XmlNodeExt<'a> {
// Required methods
fn tag_name<'s, S: Source + ?Sized>(
&self,
source: &'s S,
) -> Option<Cow<'s, str>>;
fn attributes<S: Source + ?Sized>(
&self,
source: &S,
) -> Vec<(String, String)>;
fn xml_children(&self) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>;
fn xml_children_recursive(
&self,
) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>;
fn text<S: Source + ?Sized>(&self, source: &S) -> String;
fn read_attr<S: Source + ?Sized>(
&self,
source: &S,
name: &str,
) -> Option<String>;
}Expand description
Extension trait for XML red nodes.
Required Methods§
Sourcefn tag_name<'s, S: Source + ?Sized>(
&self,
source: &'s S,
) -> Option<Cow<'s, str>>
fn tag_name<'s, S: Source + ?Sized>( &self, source: &'s S, ) -> Option<Cow<'s, str>>
Returns the tag name of the element.
Sourcefn attributes<S: Source + ?Sized>(&self, source: &S) -> Vec<(String, String)>
fn attributes<S: Source + ?Sized>(&self, source: &S) -> Vec<(String, String)>
Returns the attributes of the element.
Sourcefn xml_children(&self) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>
fn xml_children(&self) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>
Returns an iterator over the element’s children that are elements.
Sourcefn xml_children_recursive(
&self,
) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>
fn xml_children_recursive( &self, ) -> impl Iterator<Item = RedNode<'a, XmlLanguage>>
Returns a recursive iterator over all element descendants.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.