lib.rs

  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 manipulated 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#![warn(missing_docs)]
 25#![cfg_attr(docsrs, feature(doc_auto_cfg))]
 26
 27pub use blake2;
 28pub use jid;
 29pub use minidom;
 30pub use sha1;
 31pub use sha2;
 32pub use sha3;
 33
 34// We normally only reexport entire crates, but xso is a special case since it uses proc macros
 35// which require it to be directly imported as a crate.  The only useful symbol we have to reexport
 36// is its error type, which we expose in all of our return types.
 37pub use xso::error::Error;
 38
 39/// XML namespace definitions used through XMPP.
 40pub mod ns;
 41
 42#[macro_use]
 43mod util;
 44
 45/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 46pub mod bind;
 47/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 48pub mod iq;
 49/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 50pub mod message;
 51/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 52pub mod presence;
 53/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 54pub mod sasl;
 55/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 56pub mod stanza_error;
 57/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 58pub mod starttls;
 59/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 60pub mod stream;
 61/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 62pub mod stream_features;
 63
 64/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
 65pub mod roster;
 66
 67/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
 68pub mod websocket;
 69
 70/// XEP-0004: Data Forms
 71pub mod data_forms;
 72
 73/// XEP-0030: Service Discovery
 74pub mod disco;
 75
 76/// XEP-0045: Multi-User Chat
 77pub mod muc;
 78
 79/// XEP-0047: In-Band Bytestreams
 80pub mod ibb;
 81
 82/// XEP-0048: Bookmarks
 83pub mod bookmarks;
 84
 85/// XEP-0049: Private XML storage
 86pub mod private;
 87
 88/// XEP-0054: vcard-temp
 89pub mod vcard;
 90
 91/// XEP-0059: Result Set Management
 92pub mod rsm;
 93
 94/// XEP-0060: Publish-Subscribe
 95pub mod pubsub;
 96
 97/// XEP-0066: OOB
 98pub mod oob;
 99
100/// XEP-0071: XHTML-IM
101pub mod xhtml;
102
103/// XEP-0077: In-Band Registration
104pub mod ibr;
105
106/// XEP-0082: XMPP Date and Time Profiles
107pub mod date;
108
109/// XEP-0084: User Avatar
110pub mod avatar;
111
112/// XEP-0085: Chat State Notifications
113pub mod chatstates;
114
115/// XEP-0092: Software Version
116pub mod version;
117
118/// XEP-0107: User Mood
119pub mod mood;
120
121/// XEP-0114: Jabber Component Protocol
122pub mod component;
123
124/// XEP-0115: Entity Capabilities
125pub mod caps;
126
127/// XEP-0118: User Tune
128pub mod tune;
129
130/// XEP-0122: Data Forms Validation
131pub mod data_forms_validate;
132
133///XEP-0153: vCard-Based Avatars
134pub mod vcard_update;
135
136/// XEP-0157: Contact Addresses for XMPP Services
137pub mod server_info;
138
139/// XEP-0166: Jingle
140pub mod jingle;
141
142/// XEP-0167: Jingle RTP Sessions
143pub mod jingle_rtp;
144
145/// XEP-0172: User Nickname
146pub mod nick;
147
148/// XEP-0176: Jingle ICE-UDP Transport Method
149pub mod jingle_ice_udp;
150
151/// XEP-0177: Jingle Raw UDP Transport Method
152pub mod jingle_raw_udp;
153
154/// XEP-0184: Message Delivery Receipts
155pub mod receipts;
156
157/// XEP-0191: Blocking Command
158pub mod blocking;
159
160/// XEP-0198: Stream Management
161pub mod sm;
162
163/// XEP-0199: XMPP Ping
164pub mod ping;
165
166/// XEP-0202: Entity Time
167pub mod time;
168
169/// XEP-0203: Delayed Delivery
170pub mod delay;
171
172/// XEP-0215: External Service Discovery
173pub mod extdisco;
174
175/// XEP-0221: Data Forms Media Element
176pub mod media_element;
177
178/// XEP-0224: Attention
179pub mod attention;
180
181/// XEP-0231: Bits of Binary
182pub mod bob;
183
184/// XEP-0234: Jingle File Transfer
185pub mod jingle_ft;
186
187/// XEP-0257: Client Certificate Management for SASL EXTERNAL
188pub mod cert_management;
189
190/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
191pub mod jingle_s5b;
192
193/// XEP-0261: Jingle In-Band Bytestreams Transport Method
194pub mod jingle_ibb;
195
196/// XEP-0264: Jingle Content Thumbnails
197pub mod jingle_thumnails;
198
199/// XEP-0280: Message Carbons
200pub mod carbons;
201
202/// XEP-0293: Jingle RTP Feedback Negotiation
203pub mod jingle_rtcp_fb;
204
205/// XEP-0294: Jingle RTP Header Extensions Negotiation
206pub mod jingle_rtp_hdrext;
207
208/// XEP-0297: Stanza Forwarding
209pub mod forwarding;
210
211/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
212pub mod hashes;
213
214/// XEP-0301: In-Band Real Time Text
215pub mod rtt;
216
217/// XEP-0308: Last Message Correction
218pub mod message_correct;
219
220/// XEP-0313: Message Archive Management
221pub mod mam;
222
223/// XEP-0319: Last User Interaction in Presence
224pub mod idle;
225
226/// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
227pub mod jingle_dtls_srtp;
228
229/// XEP-0328: JID Prep
230pub mod jid_prep;
231
232/// XEP-0338: Jingle Grouping Framework
233pub mod jingle_grouping;
234
235/// XEP-0339: Source-Specific Media Attributes in Jingle
236pub mod jingle_ssma;
237
238/// XEP-0352: Client State Indication
239pub mod csi;
240
241/// XEP-0353: Jingle Message Initiation
242pub mod jingle_message;
243
244/// XEP-0359: Unique and Stable Stanza IDs
245pub mod stanza_id;
246
247/// XEP-0363: HTTP File Upload
248pub mod http_upload;
249
250/// XEP-0369: Mediated Information eXchange (MIX)
251pub mod mix;
252
253/// XEP-0373: OpenPGP for XMPP
254pub mod openpgp;
255
256/// XEP-0380: Explicit Message Encryption
257pub mod eme;
258
259/// XEP-0380: OMEMO Encryption (experimental version 0.3.0)
260pub mod legacy_omemo;
261
262/// XEP-0386: Bind 2
263pub mod bind2;
264
265/// XEP-0388: Extensible SASL Profile
266pub mod sasl2;
267
268/// XEP-0390: Entity Capabilities 2.0
269pub mod ecaps2;
270
271/// XEP-0402: PEP Native Bookmarks
272pub mod bookmarks2;
273
274/// XEP-0421: Anonymous unique occupant identifiers for MUCs
275pub mod occupant_id;
276
277/// XEP-0441: Message Archive Management Preferences
278pub mod mam_prefs;
279
280/// XEP-0440: SASL Channel-Binding Type Capability
281pub mod sasl_cb;
282
283/// XEP-0444: Message Reactions
284pub mod reactions;
285
286/// XEP-0478: Stream Limits Advertisement
287pub mod stream_limits;
288
289/// XEP-0484: Fast Authentication Streamlining Tokens
290pub mod fast;