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 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
 25extern crate minidom;
 26extern crate jid;
 27extern crate base64;
 28extern crate digest;
 29extern crate sha1;
 30extern crate sha2;
 31extern crate sha3;
 32extern crate blake2;
 33extern crate chrono;
 34extern crate try_from;
 35
 36/// Error type returned by every parser on failure.
 37pub mod error;
 38/// XML namespace definitions used through XMPP.
 39pub mod ns;
 40/// Various helpers.
 41pub mod helpers;
 42/// Helper macros to parse and serialise more easily.
 43#[macro_use]
 44pub mod macros;
 45
 46#[cfg(test)]
 47/// Namespace-aware comparison for tests
 48mod compare_elements;
 49
 50/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 51pub mod message;
 52/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 53pub mod presence;
 54/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 55pub mod iq;
 56/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 57pub mod stanza_error;
 58/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 59pub mod sasl;
 60
 61/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
 62pub mod roster;
 63
 64/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
 65pub mod websocket;
 66
 67/// XEP-0004: Data Forms
 68pub mod data_forms;
 69
 70/// XEP-0030: Service Discovery
 71pub mod disco;
 72
 73/// XEP-0045: Multi-User Chat
 74pub mod muc;
 75
 76/// XEP-0047: In-Band Bytestreams
 77pub mod ibb;
 78
 79/// XEP-0059: Result Set Management
 80pub mod rsm;
 81
 82/// XEP-0060: Publish-Subscribe
 83pub mod pubsub;
 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-0085: Chat State Notifications
 92pub mod chatstates;
 93
 94/// XEP-0092: Software Version
 95pub mod version;
 96
 97/// XEP-0107: User Mood
 98pub mod mood;
 99
100/// XEP-0115: Entity Capabilities
101pub mod caps;
102
103/// XEP-0166: Jingle
104pub mod jingle;
105
106/// XEP-0184: Message Delivery Receipts
107pub mod receipts;
108
109/// XEP-0191: Blocking Command
110pub mod blocking;
111
112/// XEP-0199: XMPP Ping
113pub mod ping;
114
115/// XEP-0203: Delayed Delivery
116pub mod delay;
117
118/// XEP-0221: Data Forms Media Element
119pub mod media_element;
120
121/// XEP-0224: Attention
122pub mod attention;
123
124/// XEP-0234: Jingle File Transfer
125pub mod jingle_ft;
126
127/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
128pub mod jingle_s5b;
129
130/// XEP-0261: Jingle In-Band Bytestreams Transport Method
131pub mod jingle_ibb;
132
133/// XEP-0297: Stanza Forwarding
134pub mod forwarding;
135
136/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
137pub mod hashes;
138
139/// XEP-0308: Last Message Correction
140pub mod message_correct;
141
142/// XEP-0313: Message Archive Management
143pub mod mam;
144
145/// XEP-0319: Last User Interaction in Presence
146pub mod idle;
147
148/// XEP-0353: Jingle Message Initiation
149pub mod jingle_message;
150
151/// XEP-0359: Unique and Stable Stanza IDs
152pub mod stanza_id;
153
154/// XEP-0380: Explicit Message Encryption
155pub mod eme;
156
157/// XEP-0390: Entity Capabilities 2.0
158pub mod ecaps2;