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 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#![warn(missing_docs)]
 25
 26pub use crate::util::error::Error;
 27// TODO: only export top-level module on the next major release
 28pub use jid::{self, BareJid, Error as JidParseError, FullJid, Jid};
 29pub use minidom::Element;
 30
 31/// XML namespace definitions used through XMPP.
 32pub mod ns;
 33
 34#[macro_use]
 35mod util;
 36
 37/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 38pub mod bind;
 39/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 40pub mod iq;
 41/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 42pub mod message;
 43/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 44pub mod presence;
 45/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 46pub mod sasl;
 47/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 48pub mod stanza_error;
 49/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 50pub mod stream;
 51
 52/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
 53pub mod roster;
 54
 55/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
 56pub mod websocket;
 57
 58/// XEP-0004: Data Forms
 59pub mod data_forms;
 60
 61/// XEP-0030: Service Discovery
 62pub mod disco;
 63
 64/// XEP-0045: Multi-User Chat
 65pub mod muc;
 66
 67/// XEP-0047: In-Band Bytestreams
 68pub mod ibb;
 69
 70/// XEP-0048: Bookmarks
 71pub mod bookmarks;
 72
 73/// XEP-0049: Private XML storage
 74pub mod private;
 75
 76/// XEP-0059: Result Set Management
 77pub mod rsm;
 78
 79/// XEP-0060: Publish-Subscribe
 80pub mod pubsub;
 81
 82/// XEP-0071: XHTML-IM
 83pub mod xhtml;
 84
 85/// XEP-0077: In-Band Registration
 86pub mod ibr;
 87
 88/// XEP-0082: XMPP Date and Time Profiles
 89pub mod date;
 90
 91/// XEP-0084: User Avatar
 92pub mod avatar;
 93
 94/// XEP-0085: Chat State Notifications
 95pub mod chatstates;
 96
 97/// XEP-0092: Software Version
 98pub mod version;
 99
100/// XEP-0107: User Mood
101pub mod mood;
102
103/// XEP-0114: Jabber Component Protocol
104pub mod component;
105
106/// XEP-0115: Entity Capabilities
107pub mod caps;
108
109/// XEP-0118: User Tune
110pub mod tune;
111
112/// XEP-0157: Contact Addresses for XMPP Services
113pub mod server_info;
114
115/// XEP-0166: Jingle
116pub mod jingle;
117
118/// XEP-0167: Jingle RTP Sessions
119pub mod jingle_rtp;
120
121/// XEP-0172: User Nickname
122pub mod nick;
123
124/// XEP-0176: Jingle ICE-UDP Transport Method
125pub mod jingle_ice_udp;
126
127/// XEP-0177: Jingle Raw UDP Transport Method
128pub mod jingle_raw_udp;
129
130/// XEP-0184: Message Delivery Receipts
131pub mod receipts;
132
133/// XEP-0191: Blocking Command
134pub mod blocking;
135
136/// XEP-0198: Stream Management
137pub mod sm;
138
139/// XEP-0199: XMPP Ping
140pub mod ping;
141
142/// XEP-0202: Entity Time
143pub mod time;
144
145/// XEP-0203: Delayed Delivery
146pub mod delay;
147
148/// XEP-0215: External Service Discovery
149pub mod extdisco;
150
151/// XEP-0221: Data Forms Media Element
152pub mod media_element;
153
154/// XEP-0224: Attention
155pub mod attention;
156
157/// XEP-0231: Bits of Binary
158pub mod bob;
159
160/// XEP-0234: Jingle File Transfer
161pub mod jingle_ft;
162
163/// XEP-0257: Client Certificate Management for SASL EXTERNAL
164pub mod cert_management;
165
166/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
167pub mod jingle_s5b;
168
169/// XEP-0261: Jingle In-Band Bytestreams Transport Method
170pub mod jingle_ibb;
171
172/// XEP-0280: Message Carbons
173pub mod carbons;
174
175/// XEP-0293: Jingle RTP Feedback Negotiation
176pub mod jingle_rtcp_fb;
177
178/// XEP-0294: Jingle RTP Header Extensions Negociation
179pub mod jingle_rtp_hdrext;
180
181/// XEP-0297: Stanza Forwarding
182pub mod forwarding;
183
184/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
185pub mod hashes;
186
187/// XEP-0301: In-Band Real Time Text
188pub mod rtt;
189
190/// XEP-0308: Last Message Correction
191pub mod message_correct;
192
193/// XEP-0313: Message Archive Management
194pub mod mam;
195
196/// XEP-0319: Last User Interaction in Presence
197pub mod idle;
198
199/// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
200pub mod jingle_dtls_srtp;
201
202/// XEP-0328: JID Prep
203pub mod jid_prep;
204
205/// XEP-0338: Jingle Grouping Framework
206pub mod jingle_grouping;
207
208/// XEP-0339: Source-Specific Media Attributes in Jingle
209pub mod jingle_ssma;
210
211/// XEP-0352: Client State Indication
212pub mod csi;
213
214/// XEP-0353: Jingle Message Initiation
215pub mod jingle_message;
216
217/// XEP-0359: Unique and Stable Stanza IDs
218pub mod stanza_id;
219
220/// XEP-0363: HTTP File Upload
221pub mod http_upload;
222
223/// XEP-0369: Mediated Information eXchange (MIX)
224pub mod mix;
225
226/// XEP-0373: OpenPGP for XMPP
227pub mod openpgp;
228
229/// XEP-0380: Explicit Message Encryption
230pub mod eme;
231
232/// XEP-0380: OMEMO Encryption (experimental version 0.3.0)
233pub mod legacy_omemo;
234
235/// XEP-0390: Entity Capabilities 2.0
236pub mod ecaps2;
237
238/// XEP-0402: PEP Native Bookmarks
239pub mod bookmarks2;
240
241/// XEP-0421: Anonymous unique occupant identifiers for MUCs
242pub mod occupant_id;
243
244/// XEP-0441: Message Archive Management Preferences
245pub mod mam_prefs;
246
247/// XEP-0444: Message Reactions
248pub mod reactions;