attention, chatstates, eme, ping: Add a docstring on the structs.

This commit is contained in:
Emmanuel Gil Peyrot 2017-07-20 23:47:21 +01:00
parent fd31e691af
commit 7612c53f9a
4 changed files with 18 additions and 0 deletions

View file

@ -12,6 +12,7 @@ use error::Error;
use ns;
/// Structure representing an `<attention xmlns='urn:xmpp:attention:0'/>` element.
#[derive(Debug, Clone)]
pub struct Attention;

View file

@ -12,12 +12,23 @@ use error::Error;
use ns;
/// Enum representing chatstate elements part of the
/// `http://jabber.org/protocol/chatstates` namespace.
#[derive(Debug, Clone)]
pub enum ChatState {
/// `<active xmlns='http://jabber.org/protocol/chatstates'/>`
Active,
/// `<composing xmlns='http://jabber.org/protocol/chatstates'/>`
Composing,
/// `<gone xmlns='http://jabber.org/protocol/chatstates'/>`
Gone,
/// `<inactive xmlns='http://jabber.org/protocol/chatstates'/>`
Inactive,
/// `<paused xmlns='http://jabber.org/protocol/chatstates'/>`
Paused,
}

View file

@ -12,9 +12,14 @@ use error::Error;
use ns;
/// Structure representing an `<encryption xmlns='urn:xmpp:eme:0'/>` element.
#[derive(Debug, Clone)]
pub struct ExplicitMessageEncryption {
/// Namespace of the encryption scheme used.
pub namespace: String,
/// User-friendly name for the encryption scheme, should be `None` for OTR,
/// legacy OpenPGP and OX.
pub name: Option<String>,
}

View file

@ -13,6 +13,7 @@ use error::Error;
use ns;
/// Structure representing a `<ping xmlns='urn:xmpp:ping'/>` element.
#[derive(Debug, Clone)]
pub struct Ping;