parsers: provide stub FromXml/AsXml implementations on Iq
This commit is contained in:
parent
5c990a553c
commit
b931af3c25
1 changed files with 22 additions and 0 deletions
|
|
@ -223,6 +223,28 @@ impl From<Iq> for Element {
|
|||
}
|
||||
}
|
||||
|
||||
impl ::xso::FromXml for Iq {
|
||||
type Builder = ::xso::minidom_compat::FromEventsViaElement<Iq>;
|
||||
|
||||
fn from_events(
|
||||
qname: ::xso::exports::rxml::QName,
|
||||
attrs: ::xso::exports::rxml::AttrMap,
|
||||
) -> Result<Self::Builder, ::xso::error::FromEventsError> {
|
||||
if qname.0 != crate::ns::DEFAULT_NS || qname.1 != "iq" {
|
||||
return Err(::xso::error::FromEventsError::Mismatch { name: qname, attrs });
|
||||
}
|
||||
Self::Builder::new(qname, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::xso::AsXml for Iq {
|
||||
type ItemIter<'x> = ::xso::minidom_compat::AsItemsViaElement<'x>;
|
||||
|
||||
fn as_xml_iter(&self) -> Result<Self::ItemIter<'_>, ::xso::error::Error> {
|
||||
::xso::minidom_compat::AsItemsViaElement::new(self.clone())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Reference in a new issue