roster: Document most structs and their fields.

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-29 06:22:35 +01:00
parent 56a66f8c4b
commit a04c395122

View file

@ -23,11 +23,19 @@ generate_attribute!(Subscription, "subscription", {
Remove => "remove", Remove => "remove",
}); });
/// Contact from the users contact list.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub struct Item { pub struct Item {
/// JID of this contact.
pub jid: Jid, pub jid: Jid,
/// Name of this contact.
pub name: Option<String>, pub name: Option<String>,
/// Subscription status of this contact.
pub subscription: Option<Subscription>, pub subscription: Option<Subscription>,
/// Groups this contact is part of.
pub groups: Vec<Group>, pub groups: Vec<Group>,
} }
@ -74,9 +82,17 @@ impl From<Item> for Element {
} }
} }
/// The contact list of the user.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Roster { 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<String>, pub ver: Option<String>,
/// List of the contacts of the user.
pub items: Vec<Item>, pub items: Vec<Item>,
} }