message, presence, iq: Improve documentation.
This commit is contained in:
parent
5df585ca40
commit
87af0f3615
4 changed files with 13 additions and 2 deletions
|
@ -190,6 +190,7 @@ impl<'a> IntoAttributeValue for &'a IqType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The main structure representing the `<iq/>` stanza.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Iq {
|
pub struct Iq {
|
||||||
pub from: Option<Jid>,
|
pub from: Option<Jid>,
|
||||||
|
|
12
src/lib.rs
12
src/lib.rs
|
@ -58,7 +58,11 @@ macro_rules! generate_attribute {
|
||||||
($elem:ident, $name:tt, {$($a:ident => $b:tt),+}) => (
|
($elem:ident, $name:tt, {$($a:ident => $b:tt),+}) => (
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub enum $elem {
|
pub enum $elem {
|
||||||
$($a),+
|
$(
|
||||||
|
#[doc=$b]
|
||||||
|
#[doc="value for this attribute."]
|
||||||
|
$a
|
||||||
|
),+
|
||||||
}
|
}
|
||||||
impl FromStr for $elem {
|
impl FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
@ -80,7 +84,11 @@ macro_rules! generate_attribute {
|
||||||
($elem:ident, $name:tt, {$($a:ident => $b:tt),+}, Default = $default:ident) => (
|
($elem:ident, $name:tt, {$($a:ident => $b:tt),+}, Default = $default:ident) => (
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub enum $elem {
|
pub enum $elem {
|
||||||
$($a),+
|
$(
|
||||||
|
#[doc=$b]
|
||||||
|
#[doc="value for this attribute."]
|
||||||
|
$a
|
||||||
|
),+
|
||||||
}
|
}
|
||||||
impl FromStr for $elem {
|
impl FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
|
|
@ -115,6 +115,7 @@ type Body = String;
|
||||||
type Subject = String;
|
type Subject = String;
|
||||||
type Thread = String;
|
type Thread = String;
|
||||||
|
|
||||||
|
/// The main structure representing the `<message/>` stanza.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
pub from: Option<Jid>,
|
pub from: Option<Jid>,
|
||||||
|
|
|
@ -186,6 +186,7 @@ impl IntoAttributeValue for Type {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The main structure representing the `<presence/>` stanza.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Presence {
|
pub struct Presence {
|
||||||
pub from: Option<Jid>,
|
pub from: Option<Jid>,
|
||||||
|
|
Loading…
Reference in a new issue