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