xmpp-parsers: Split vCard-temp iq get into new VCardQuery
There is no reason to force users to use the same struct for both.
This commit is contained in:
parent
0adca163f8
commit
86b65ab447
2 changed files with 10 additions and 1 deletions
|
|
@ -46,6 +46,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
|
||||||
cert_management::Item::no_cert_management,
|
cert_management::Item::no_cert_management,
|
||||||
ssm::StreamManagement::optional and starttls::StartTls::required are
|
ssm::StreamManagement::optional and starttls::StartTls::required are
|
||||||
now proper bools, instead of Option<ZeroSizedType> (!518)
|
now proper bools, instead of Option<ZeroSizedType> (!518)
|
||||||
|
- vCard-temp queries have been split into vcard::VCardQuery (!522)
|
||||||
* New parsers/serialisers:
|
* New parsers/serialisers:
|
||||||
- Stream Features (RFC 6120) (!400)
|
- Stream Features (RFC 6120) (!400)
|
||||||
- Spam Reporting (XEP-0377) (!506)
|
- Spam Reporting (XEP-0377) (!506)
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,16 @@ pub struct VCard {
|
||||||
pub payloads: Vec<Element>,
|
pub payloads: Vec<Element>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IqGetPayload for VCard {}
|
|
||||||
impl IqSetPayload for VCard {}
|
impl IqSetPayload for VCard {}
|
||||||
impl IqResultPayload for VCard {}
|
impl IqResultPayload for VCard {}
|
||||||
|
|
||||||
|
/// A `<vCard/>` request element, for use in iq get.
|
||||||
|
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]
|
||||||
|
#[xml(namespace = ns::VCARD, name = "vCard")]
|
||||||
|
pub struct VCardQuery;
|
||||||
|
|
||||||
|
impl IqGetPayload for VCardQuery {}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
@ -82,6 +88,7 @@ mod tests {
|
||||||
assert_size!(Type, 12);
|
assert_size!(Type, 12);
|
||||||
assert_size!(Binval, 12);
|
assert_size!(Binval, 12);
|
||||||
assert_size!(VCard, 36);
|
assert_size!(VCard, 36);
|
||||||
|
assert_size!(VCardQuery, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "64")]
|
#[cfg(target_pointer_width = "64")]
|
||||||
|
|
@ -91,6 +98,7 @@ mod tests {
|
||||||
assert_size!(Type, 24);
|
assert_size!(Type, 24);
|
||||||
assert_size!(Binval, 24);
|
assert_size!(Binval, 24);
|
||||||
assert_size!(VCard, 72);
|
assert_size!(VCard, 72);
|
||||||
|
assert_size!(VCardQuery, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue