Skip to main content

DomXmlExt

Trait DomXmlExt 

Source
pub trait DomXmlExt {
    // Required method
    fn from_xml_string<S: AsRef<str>>(xml: S) -> StyledDom;
}
Expand description

Extension trait to add XML parsing capabilities to Dom

This trait provides methods to parse XML/XHTML strings and convert them into Azul DOM trees. It’s implemented as a trait to avoid circular dependencies between azul-core and azul-layout.

Required Methods§

Source

fn from_xml_string<S: AsRef<str>>(xml: S) -> StyledDom

Parse XML/XHTML string into a DOM tree

This method parses the XML string and converts it to an Azul StyledDom. On error, it returns a StyledDom displaying the error message.

§Arguments
  • xml - The XML/XHTML string to parse
§Returns

A StyledDom tree representing the parsed XML, or an error DOM on parse failure

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.

Implementations on Foreign Types§

Source§

impl DomXmlExt for Dom

Available on crate feature xml only.

Implementors§