Skip to main content

FromXml

Trait FromXml 

Source
pub trait FromXml: Sized {
    // Required method
    fn from_xml<R: BufRead>(
        reader: &mut Reader<R>,
        start_tag: &BytesStart<'_>,
        is_empty: bool,
    ) -> Result<Self, ParseError>;
}
Expand description

Trait for types that can be parsed from XML elements.

Implemented by generated OOXML types to enable event-based parsing.

Required Methods§

Source

fn from_xml<R: BufRead>( reader: &mut Reader<R>, start_tag: &BytesStart<'_>, is_empty: bool, ) -> Result<Self, ParseError>

Parse from an XML reader positioned at the start tag.

  • reader: The XML reader
  • start_tag: The start tag that was just read
  • is_empty: True if this is an empty element (e.g., <foo/>)

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.

Implementors§