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//! [`TryFrom<Element>`]: ../try_from/trait.TryFrom.html
 16//! [`Element`]: ../minidom/element/struct.Element.html
 17
 18// Copyright (c) 2017-2018 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
 19// Copyright (c) 2017 Maxime “pep” Buquet <pep+code@bouah.net>
 20//
 21// This Source Code Form is subject to the terms of the Mozilla Public
 22// License, v. 2.0. If a copy of the MPL was not distributed with this
 23// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 24
 25#![deny(missing_docs)]
 26
 27extern crate base64;
 28extern crate blake2;
 29extern crate chrono;
 30extern crate digest;
 31extern crate jid;
 32extern crate minidom;
 33extern crate sha1;
 34extern crate sha2;
 35extern crate sha3;
 36extern crate try_from;
 37
 38pub use minidom::Element;
 39
 40/// Error type returned by every parser on failure.
 41pub mod error;
 42/// XML namespace definitions used through XMPP.
 43pub mod ns;
 44
 45/// Various helpers.
 46mod helpers;
 47/// Helper macros to parse and serialise more easily.
 48#[macro_use]
 49mod macros;
 50
 51#[cfg(test)]
 52/// Namespace-aware comparison for tests
 53mod compare_elements;
 54
 55/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 56pub mod bind;
 57/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 58pub mod iq;
 59/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 60pub mod message;
 61/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 62pub mod presence;
 63/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 64pub mod sasl;
 65/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 66pub mod stanza_error;
 67/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 68pub mod stream;
 69
 70/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
 71pub mod roster;
 72
 73/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
 74pub mod websocket;
 75
 76/// XEP-0004: Data Forms
 77pub mod data_forms;
 78
 79/// XEP-0030: Service Discovery
 80pub mod disco;
 81
 82/// XEP-0045: Multi-User Chat
 83pub mod muc;
 84
 85/// XEP-0047: In-Band Bytestreams
 86pub mod ibb;
 87
 88/// XEP-0048: Bookmarks
 89pub mod bookmarks;
 90
 91/// XEP-0059: Result Set Management
 92pub mod rsm;
 93
 94/// XEP-0060: Publish-Subscribe
 95pub mod pubsub;
 96
 97/// XEP-0077: In-Band Registration
 98pub mod ibr;
 99
100/// XEP-0082: XMPP Date and Time Profiles
101pub mod date;
102
103/// XEP-0085: Chat State Notifications
104pub mod chatstates;
105
106/// XEP-0092: Software Version
107pub mod version;
108
109/// XEP-0107: User Mood
110pub mod mood;
111
112/// XEP-0114: Jabber Component Protocol
113pub mod component;
114
115/// XEP-0115: Entity Capabilities
116pub mod caps;
117
118/// XEP-0166: Jingle
119pub mod jingle;
120
121/// XEP-0172: User Nickname
122pub mod nick;
123
124/// XEP-0184: Message Delivery Receipts
125pub mod receipts;
126
127/// XEP-0191: Blocking Command
128pub mod blocking;
129
130/// XEP-0198: Stream Management
131pub mod sm;
132
133/// XEP-0199: XMPP Ping
134pub mod ping;
135
136/// XEP-0203: Delayed Delivery
137pub mod delay;
138
139/// XEP-0221: Data Forms Media Element
140pub mod media_element;
141
142/// XEP-0224: Attention
143pub mod attention;
144
145/// XEP-0234: Jingle File Transfer
146pub mod jingle_ft;
147
148/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
149pub mod jingle_s5b;
150
151/// XEP-0261: Jingle In-Band Bytestreams Transport Method
152pub mod jingle_ibb;
153
154/// XEP-0297: Stanza Forwarding
155pub mod forwarding;
156
157/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
158pub mod hashes;
159
160/// XEP-0308: Last Message Correction
161pub mod message_correct;
162
163/// XEP-0313: Message Archive Management
164pub mod mam;
165
166/// XEP-0319: Last User Interaction in Presence
167pub mod idle;
168
169/// XEP-0353: Jingle Message Initiation
170pub mod jingle_message;
171
172/// XEP-0359: Unique and Stable Stanza IDs
173pub mod stanza_id;
174
175/// XEP-0380: Explicit Message Encryption
176pub mod eme;
177
178/// XEP-0390: Entity Capabilities 2.0
179pub mod ecaps2;