From a04c39512202a83422b64e279cfda31bb3ad3bd2 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 29 Jul 2017 06:22:35 +0100 Subject: [PATCH] roster: Document most structs and their fields. --- src/roster.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/roster.rs b/src/roster.rs index a1a07eb..82488a3 100644 --- a/src/roster.rs +++ b/src/roster.rs @@ -23,11 +23,19 @@ generate_attribute!(Subscription, "subscription", { Remove => "remove", }); +/// Contact from the user’s contact list. #[derive(Debug, Clone, PartialEq)] pub struct Item { + /// JID of this contact. pub jid: Jid, + + /// Name of this contact. pub name: Option, + + /// Subscription status of this contact. pub subscription: Option, + + /// Groups this contact is part of. pub groups: Vec, } @@ -74,9 +82,17 @@ impl From for Element { } } +/// The contact list of the user. #[derive(Debug, Clone)] pub struct Roster { + /// Version of the contact list. + /// + /// This is an opaque string that should only be sent back to the server on + /// a new connection, if this client is storing the contact list between + /// connections. pub ver: Option, + + /// List of the contacts of the user. pub items: Vec, }