iq: Implement the Iq*Payload traits on every possible payload.

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-16 15:08:17 +02:00
commit 412eafb363
11 changed files with 64 additions and 0 deletions

View file

@ -11,6 +11,7 @@ use jid::Jid;
use error::Error;
use iq::{IqGetPayload, IqSetPayload, IqResultPayload};
use data_forms::DataForm;
use rsm::Set;
use forwarding::Forwarded;
@ -25,6 +26,10 @@ pub struct Query {
pub set: Option<Set>,
}
impl IqGetPayload for Query {}
impl IqSetPayload for Query {}
impl IqResultPayload for Query {}
generate_element_with_children!(
Result_, "result", MAM,
attributes: [
@ -42,6 +47,8 @@ pub struct Fin {
pub set: Set,
}
impl IqResultPayload for Fin {}
generate_attribute!(DefaultPrefs, "default", {
Always => "always",
Never => "never",
@ -55,6 +62,10 @@ pub struct Prefs {
pub never: Vec<Jid>,
}
impl IqGetPayload for Prefs {}
impl IqSetPayload for Prefs {}
impl IqResultPayload for Prefs {}
impl TryFrom<Element> for Query {
type Err = Error;