xso: create library for streamed XML parsing
This library provides the traits to parse structs from XML and serialise them into XML without having to buffer the document object model in memory. The only implementations it provides are for minidom, basically providing a lower-level interface to `minidom::Element::from_reader` and `minidom::Element::to_writer`. This is the first stepping stone into a world where `xmpp_parsers` can parse the structs directly from XML.
This commit is contained in:
parent
998d2825f8
commit
14a1d66bf8
6 changed files with 497 additions and 0 deletions
|
|
@ -427,6 +427,11 @@ impl Element {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Extracts all children into a collection.
|
||||
pub fn take_nodes(&mut self) -> Vec<Node> {
|
||||
self.children.drain(..).collect()
|
||||
}
|
||||
|
||||
/// Returns an iterator over references to every child node of this element.
|
||||
///
|
||||
/// # Examples
|
||||
|
|
|
|||
Loading…
Reference in a new issue