pub trait CollectXmlwhere
    Self: Sized,{
    // Required method
    fn collect_xml(self) -> Xml;
}
Expand description

Collect XML from an iterator.

Example

use inline_xml::*;

let v = [1, 2, 3];
let xml = xml! {
    <root>
    {v.into_iter().map(|x| xml! { <p>{x}</p> }).collect_xml()}
    </root>
};
println!("{xml}");

Output

<root>
    <p>1</p>
    <p>2</p>
    <p>3</p>
</root>

Required Methods§

Implementors§

source§

impl<T, I> CollectXml for Iwhere T: ToXml, I: Iterator<Item = T>,