1//! A crate parsing common XMPP elements into Rust structures.
2//!
3//! Each module implements the `TryFrom<Element>` trait, which takes a
4//! minidom [`Element`] and returns a `Result` whose value is `Ok` if the
5//! element parsed correctly, `Err(error::Error)` otherwise.
6//!
7//! The returned structure can be manipuled as any Rust structure, with each
8//! field being public. You can also create the same structure manually, with
9//! some having `new()` and `with_*()` helper methods to create them.
10//!
11//! Once you are happy with your structure, you can serialise it back to an
12//! [`Element`], using either `From` or `Into<Element>`, which give you what
13//! you want to be sending on the wire.
14//!
15//! [`Element`]: ../minidom/element/struct.Element.html
16
17// Copyright (c) 2017-2019 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
18// Copyright (c) 2017-2019 Maxime “pep” Buquet <pep@bouah.net>
19//
20// This Source Code Form is subject to the terms of the Mozilla Public
21// License, v. 2.0. If a copy of the MPL was not distributed with this
22// file, You can obtain one at http://mozilla.org/MPL/2.0/.
23
24#![deny(missing_docs)]
25
26pub use minidom::Element;
27pub use jid::{BareJid, FullJid, Jid, JidParseError};
28pub use crate::util::error::Error;
29
30/// XML namespace definitions used through XMPP.
31pub mod ns;
32
33#[macro_use]
34mod util;
35
36/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
37pub mod bind;
38/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
39pub mod iq;
40/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
41pub mod message;
42/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
43pub mod presence;
44/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
45pub mod sasl;
46/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
47pub mod stanza_error;
48/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
49pub mod stream;
50
51/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
52pub mod roster;
53
54/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
55pub mod websocket;
56
57/// XEP-0004: Data Forms
58pub mod data_forms;
59
60/// XEP-0030: Service Discovery
61pub mod disco;
62
63/// XEP-0045: Multi-User Chat
64pub mod muc;
65
66/// XEP-0047: In-Band Bytestreams
67pub mod ibb;
68
69/// XEP-0048: Bookmarks
70pub mod bookmarks;
71
72/// XEP-0059: Result Set Management
73pub mod rsm;
74
75/// XEP-0060: Publish-Subscribe
76pub mod pubsub;
77
78/// XEP-0077: In-Band Registration
79pub mod ibr;
80
81/// XEP-0082: XMPP Date and Time Profiles
82pub mod date;
83
84/// XEP-0084: User Avatar
85pub mod avatar;
86
87/// XEP-0085: Chat State Notifications
88pub mod chatstates;
89
90/// XEP-0092: Software Version
91pub mod version;
92
93/// XEP-0107: User Mood
94pub mod mood;
95
96/// XEP-0114: Jabber Component Protocol
97pub mod component;
98
99/// XEP-0115: Entity Capabilities
100pub mod caps;
101
102/// XEP-0157: Contact Addresses for XMPP Services
103pub mod server_info;
104
105/// XEP-0166: Jingle
106pub mod jingle;
107
108/// XEP-0167: Jingle RTP Sessions
109pub mod jingle_rtp;
110
111/// XEP-0172: User Nickname
112pub mod nick;
113
114/// XEP-0176: Jingle ICE-UDP Transport Method
115pub mod jingle_ice_udp;
116
117/// XEP-0184: Message Delivery Receipts
118pub mod receipts;
119
120/// XEP-0191: Blocking Command
121pub mod blocking;
122
123/// XEP-0198: Stream Management
124pub mod sm;
125
126/// XEP-0199: XMPP Ping
127pub mod ping;
128
129/// XEP-0202: Entity Time
130pub mod time;
131
132/// XEP-0203: Delayed Delivery
133pub mod delay;
134
135/// XEP-0221: Data Forms Media Element
136pub mod media_element;
137
138/// XEP-0224: Attention
139pub mod attention;
140
141/// XEP-0231: Bits of Binary
142pub mod bob;
143
144/// XEP-0234: Jingle File Transfer
145pub mod jingle_ft;
146
147/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
148pub mod jingle_s5b;
149
150/// XEP-0261: Jingle In-Band Bytestreams Transport Method
151pub mod jingle_ibb;
152
153/// XEP-0280: Message Carbons
154pub mod carbons;
155
156/// XEP-0297: Stanza Forwarding
157pub mod forwarding;
158
159/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
160pub mod hashes;
161
162/// XEP-0308: Last Message Correction
163pub mod message_correct;
164
165/// XEP-0313: Message Archive Management
166pub mod mam;
167
168/// XEP-0319: Last User Interaction in Presence
169pub mod idle;
170
171/// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
172pub mod jingle_dtls_srtp;
173
174/// XEP-0353: Jingle Message Initiation
175pub mod jingle_message;
176
177/// XEP-0359: Unique and Stable Stanza IDs
178pub mod stanza_id;
179
180/// XEP-0380: Explicit Message Encryption
181pub mod eme;
182
183/// XEP-0390: Entity Capabilities 2.0
184pub mod ecaps2;