From cacafe7ea1b482ee2875b676e22eaf9914f44c27 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 1 Aug 2018 00:16:59 +0200 Subject: [PATCH] stanza_id: Document this module. --- src/stanza_id.rs | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/stanza_id.rs b/src/stanza_id.rs index 16a8d9fc..dc626888 100644 --- a/src/stanza_id.rs +++ b/src/stanza_id.rs @@ -4,18 +4,32 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#![deny(missing_docs)] + use jid::Jid; -generate_element!(StanzaId, "stanza-id", SID, -attributes: [ - id: String = "id" => required, - by: Jid = "by" => required, -]); +generate_element!( + /// Gives the identifier a service has stamped on this stanza, often in + /// order to identify it inside of [an archive](../mam/index.html). + StanzaId, "stanza-id", SID, + attributes: [ + /// The id associated to this stanza by another entity. + id: String = "id" => required, -generate_element!(OriginId, "origin-id", SID, -attributes: [ - id: String = "id" => required, -]); + /// The entity who stamped this stanza-id. + by: Jid = "by" => required, + ] +); + +generate_element!( + /// A hack for MUC before version 1.31 to track a message which may have + /// its 'id' attribute changed. + OriginId, "origin-id", SID, + attributes: [ + /// The id this client set for this stanza. + id: String = "id" => required, + ] +); #[cfg(test)] mod tests {