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
 27pub use minidom::Element;
 28pub use jid::{Jid, JidParseError};
 29pub use try_from::TryFrom;
 30pub use crate::util::error::Error;
 31
 32/// XML namespace definitions used through XMPP.
 33pub mod ns;
 34
 35#[macro_use]
 36mod util;
 37
 38/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 39pub mod bind;
 40/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 41pub mod iq;
 42/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 43pub mod message;
 44/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 45pub mod presence;
 46/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 47pub mod sasl;
 48/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 49pub mod stanza_error;
 50/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
 51pub mod stream;
 52
 53/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
 54pub mod roster;
 55
 56/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
 57pub mod websocket;
 58
 59/// XEP-0004: Data Forms
 60pub mod data_forms;
 61
 62/// XEP-0030: Service Discovery
 63pub mod disco;
 64
 65/// XEP-0045: Multi-User Chat
 66pub mod muc;
 67
 68/// XEP-0047: In-Band Bytestreams
 69pub mod ibb;
 70
 71/// XEP-0048: Bookmarks
 72pub mod bookmarks;
 73
 74/// XEP-0059: Result Set Management
 75pub mod rsm;
 76
 77/// XEP-0060: Publish-Subscribe
 78pub mod pubsub;
 79
 80/// XEP-0077: In-Band Registration
 81pub mod ibr;
 82
 83/// XEP-0082: XMPP Date and Time Profiles
 84pub mod date;
 85
 86/// XEP-0084: User Avatar
 87pub mod avatar;
 88
 89/// XEP-0085: Chat State Notifications
 90pub mod chatstates;
 91
 92/// XEP-0092: Software Version
 93pub mod version;
 94
 95/// XEP-0107: User Mood
 96pub mod mood;
 97
 98/// XEP-0114: Jabber Component Protocol
 99pub mod component;
100
101/// XEP-0115: Entity Capabilities
102pub mod caps;
103
104/// XEP-0166: Jingle
105pub mod jingle;
106
107/// XEP-0167: Jingle RTP Sessions
108pub mod jingle_rtp;
109
110/// XEP-0172: User Nickname
111pub mod nick;
112
113/// XEP-0176: Jingle ICE-UDP Transport Method
114pub mod jingle_ice_udp;
115
116/// XEP-0184: Message Delivery Receipts
117pub mod receipts;
118
119/// XEP-0191: Blocking Command
120pub mod blocking;
121
122/// XEP-0198: Stream Management
123pub mod sm;
124
125/// XEP-0199: XMPP Ping
126pub mod ping;
127
128/// XEP-0203: Delayed Delivery
129pub mod delay;
130
131/// XEP-0221: Data Forms Media Element
132pub mod media_element;
133
134/// XEP-0224: Attention
135pub mod attention;
136
137/// XEP-0234: Jingle File Transfer
138pub mod jingle_ft;
139
140/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
141pub mod jingle_s5b;
142
143/// XEP-0261: Jingle In-Band Bytestreams Transport Method
144pub mod jingle_ibb;
145
146/// XEP-0297: Stanza Forwarding
147pub mod forwarding;
148
149/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
150pub mod hashes;
151
152/// XEP-0308: Last Message Correction
153pub mod message_correct;
154
155/// XEP-0313: Message Archive Management
156pub mod mam;
157
158/// XEP-0319: Last User Interaction in Presence
159pub mod idle;
160
161/// XEP-0353: Jingle Message Initiation
162pub mod jingle_message;
163
164/// XEP-0359: Unique and Stable Stanza IDs
165pub mod stanza_id;
166
167/// XEP-0380: Explicit Message Encryption
168pub mod eme;
169
170/// XEP-0390: Entity Capabilities 2.0
171pub mod ecaps2;