2017-04-21 01:06:30 +01:00
|
|
|
//! A crate parsing common XMPP elements into Rust structures.
|
|
|
|
|
//!
|
2019-07-17 22:26:41 +02:00
|
|
|
//! Each module implements the `TryFrom<Element>` trait, which takes a
|
2017-07-29 05:24:20 +01:00
|
|
|
//! minidom [`Element`] and returns a `Result` whose value is `Ok` if the
|
2017-07-20 23:46:44 +01:00
|
|
|
//! element parsed correctly, `Err(error::Error)` otherwise.
|
2017-04-21 01:06:30 +01:00
|
|
|
//!
|
2024-07-24 22:38:58 +02:00
|
|
|
//! The returned structure can be manipulated as any Rust structure, with each
|
2017-07-20 23:46:44 +01:00
|
|
|
//! field being public. You can also create the same structure manually, with
|
|
|
|
|
//! some having `new()` and `with_*()` helper methods to create them.
|
|
|
|
|
//!
|
|
|
|
|
//! Once you are happy with your structure, you can serialise it back to an
|
|
|
|
|
//! [`Element`], using either `From` or `Into<Element>`, which give you what
|
|
|
|
|
//! you want to be sending on the wire.
|
|
|
|
|
//!
|
|
|
|
|
//! [`Element`]: ../minidom/element/struct.Element.html
|
2017-04-21 01:06:30 +01:00
|
|
|
|
2019-06-10 23:17:09 +02:00
|
|
|
// Copyright (c) 2017-2019 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
|
|
|
|
|
// Copyright (c) 2017-2019 Maxime “pep” Buquet <pep@bouah.net>
|
2017-04-29 22:14:34 +01:00
|
|
|
//
|
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
2021-12-27 12:30:55 +01:00
|
|
|
#![warn(missing_docs)]
|
2025-10-25 18:38:45 +02:00
|
|
|
#![deny(
|
|
|
|
|
non_camel_case_types,
|
|
|
|
|
non_snake_case,
|
|
|
|
|
unsafe_code,
|
|
|
|
|
unused_variables,
|
|
|
|
|
unused_mut,
|
|
|
|
|
dead_code
|
|
|
|
|
)]
|
2025-10-08 12:54:51 +02:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
|
#![cfg_attr(docsrs, doc(auto_cfg))]
|
2018-08-08 18:48:05 +02:00
|
|
|
|
2024-12-19 19:37:37 +01:00
|
|
|
extern crate alloc;
|
|
|
|
|
|
2024-01-16 15:18:26 +01:00
|
|
|
pub use blake2;
|
2024-07-24 20:28:22 +02:00
|
|
|
pub use jid;
|
|
|
|
|
pub use minidom;
|
2024-01-16 15:18:26 +01:00
|
|
|
pub use sha1;
|
|
|
|
|
pub use sha2;
|
|
|
|
|
pub use sha3;
|
|
|
|
|
|
2024-07-24 20:28:22 +02:00
|
|
|
// We normally only reexport entire crates, but xso is a special case since it uses proc macros
|
|
|
|
|
// which require it to be directly imported as a crate. The only useful symbol we have to reexport
|
2025-08-14 15:24:09 +02:00
|
|
|
// are its error types, which we expose in our return types.
|
|
|
|
|
pub use xso::error::{Error, FromElementError};
|
2024-07-24 20:28:22 +02:00
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XML namespace definitions used through XMPP.
|
2017-04-18 20:44:36 +01:00
|
|
|
pub mod ns;
|
2018-05-28 17:32:27 +02:00
|
|
|
|
2017-10-31 21:17:24 +00:00
|
|
|
#[macro_use]
|
2019-01-13 12:39:51 +01:00
|
|
|
mod util;
|
2017-08-19 00:04:18 +01:00
|
|
|
|
2018-12-18 15:32:05 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
|
|
|
|
pub mod bind;
|
|
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
|
|
|
|
pub mod iq;
|
2017-04-23 15:13:03 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
|
|
|
|
pub mod message;
|
2017-04-21 01:06:30 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2017-04-23 17:30:23 +01:00
|
|
|
pub mod presence;
|
2017-04-23 20:38:13 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2018-12-18 15:32:05 +01:00
|
|
|
pub mod sasl;
|
2017-05-01 01:24:45 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
|
|
|
|
pub mod stanza_error;
|
2018-02-20 17:01:12 +01:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2024-08-10 12:19:30 +02:00
|
|
|
pub mod starttls;
|
|
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2018-03-01 10:08:30 +01:00
|
|
|
pub mod stream;
|
2024-07-31 21:22:04 +02:00
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2024-08-18 12:29:13 +02:00
|
|
|
pub mod stream_error;
|
|
|
|
|
/// RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
|
2024-07-31 21:22:04 +02:00
|
|
|
pub mod stream_features;
|
2017-04-23 19:28:25 +01:00
|
|
|
|
2017-05-28 16:30:43 +01:00
|
|
|
/// RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence
|
|
|
|
|
pub mod roster;
|
|
|
|
|
|
2018-02-20 16:20:45 +01:00
|
|
|
/// RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket
|
|
|
|
|
pub mod websocket;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0004: Data Forms
|
2017-04-18 20:44:36 +01:00
|
|
|
pub mod data_forms;
|
2017-04-21 01:06:30 +01:00
|
|
|
|
|
|
|
|
/// XEP-0030: Service Discovery
|
|
|
|
|
pub mod disco;
|
|
|
|
|
|
2017-05-30 22:02:56 +01:00
|
|
|
/// XEP-0045: Multi-User Chat
|
|
|
|
|
pub mod muc;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0047: In-Band Bytestreams
|
2017-04-19 21:52:14 +01:00
|
|
|
pub mod ibb;
|
2017-04-21 01:06:30 +01:00
|
|
|
|
2018-05-29 15:04:16 +02:00
|
|
|
/// XEP-0048: Bookmarks
|
|
|
|
|
pub mod bookmarks;
|
|
|
|
|
|
2023-12-16 15:14:28 +01:00
|
|
|
/// XEP-0049: Private XML storage
|
|
|
|
|
pub mod private;
|
|
|
|
|
|
2024-01-10 21:50:34 +01:00
|
|
|
/// XEP-0054: vcard-temp
|
|
|
|
|
pub mod vcard;
|
|
|
|
|
|
2017-04-29 04:37:18 +01:00
|
|
|
/// XEP-0059: Result Set Management
|
|
|
|
|
pub mod rsm;
|
|
|
|
|
|
2017-06-11 14:48:31 +01:00
|
|
|
/// XEP-0060: Publish-Subscribe
|
|
|
|
|
pub mod pubsub;
|
|
|
|
|
|
2024-04-15 16:19:24 +02:00
|
|
|
/// XEP-0066: OOB
|
|
|
|
|
pub mod oob;
|
|
|
|
|
|
2025-08-28 22:01:41 +02:00
|
|
|
/// XEP-0070: Verifying HTTP Requests via XMPP
|
|
|
|
|
pub mod confirm;
|
|
|
|
|
|
2019-08-25 19:01:51 +02:00
|
|
|
/// XEP-0071: XHTML-IM
|
|
|
|
|
pub mod xhtml;
|
|
|
|
|
|
2017-06-25 21:03:48 +01:00
|
|
|
/// XEP-0077: In-Band Registration
|
|
|
|
|
pub mod ibr;
|
|
|
|
|
|
2017-10-31 19:41:45 +00:00
|
|
|
/// XEP-0082: XMPP Date and Time Profiles
|
|
|
|
|
pub mod date;
|
|
|
|
|
|
2019-01-25 02:57:37 +01:00
|
|
|
/// XEP-0084: User Avatar
|
|
|
|
|
pub mod avatar;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0085: Chat State Notifications
|
|
|
|
|
pub mod chatstates;
|
|
|
|
|
|
2017-07-29 11:45:45 +01:00
|
|
|
/// XEP-0092: Software Version
|
|
|
|
|
pub mod version;
|
|
|
|
|
|
2017-11-24 05:20:36 +00:00
|
|
|
/// XEP-0107: User Mood
|
|
|
|
|
pub mod mood;
|
|
|
|
|
|
2018-03-01 10:57:01 +01:00
|
|
|
/// XEP-0114: Jabber Component Protocol
|
|
|
|
|
pub mod component;
|
|
|
|
|
|
2017-05-25 02:34:03 +01:00
|
|
|
/// XEP-0115: Entity Capabilities
|
|
|
|
|
pub mod caps;
|
|
|
|
|
|
2019-09-05 15:37:34 +02:00
|
|
|
/// XEP-0118: User Tune
|
|
|
|
|
pub mod tune;
|
|
|
|
|
|
2024-06-30 11:25:45 +02:00
|
|
|
/// XEP-0122: Data Forms Validation
|
|
|
|
|
pub mod data_forms_validate;
|
|
|
|
|
|
2024-01-10 23:22:16 +01:00
|
|
|
///XEP-0153: vCard-Based Avatars
|
|
|
|
|
pub mod vcard_update;
|
|
|
|
|
|
2019-01-26 20:05:48 +00:00
|
|
|
/// XEP-0157: Contact Addresses for XMPP Services
|
|
|
|
|
pub mod server_info;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0166: Jingle
|
|
|
|
|
pub mod jingle;
|
|
|
|
|
|
2019-02-27 18:13:06 +01:00
|
|
|
/// XEP-0167: Jingle RTP Sessions
|
|
|
|
|
pub mod jingle_rtp;
|
|
|
|
|
|
2018-05-14 17:43:03 +02:00
|
|
|
/// XEP-0172: User Nickname
|
|
|
|
|
pub mod nick;
|
|
|
|
|
|
2019-02-27 18:13:18 +01:00
|
|
|
/// XEP-0176: Jingle ICE-UDP Transport Method
|
|
|
|
|
pub mod jingle_ice_udp;
|
|
|
|
|
|
2020-12-10 00:23:03 +01:00
|
|
|
/// XEP-0177: Jingle Raw UDP Transport Method
|
|
|
|
|
pub mod jingle_raw_udp;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0184: Message Delivery Receipts
|
2017-04-20 00:43:33 +01:00
|
|
|
pub mod receipts;
|
2017-04-19 23:21:53 +01:00
|
|
|
|
2017-10-31 15:48:11 +00:00
|
|
|
/// XEP-0191: Blocking Command
|
|
|
|
|
pub mod blocking;
|
|
|
|
|
|
2018-05-18 19:04:02 +02:00
|
|
|
/// XEP-0198: Stream Management
|
|
|
|
|
pub mod sm;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0199: XMPP Ping
|
|
|
|
|
pub mod ping;
|
|
|
|
|
|
2019-04-22 11:58:13 +02:00
|
|
|
/// XEP-0202: Entity Time
|
|
|
|
|
pub mod time;
|
|
|
|
|
|
2017-04-21 03:57:34 +01:00
|
|
|
/// XEP-0203: Delayed Delivery
|
|
|
|
|
pub mod delay;
|
|
|
|
|
|
2021-10-11 12:36:53 +02:00
|
|
|
/// XEP-0215: External Service Discovery
|
|
|
|
|
pub mod extdisco;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0221: Data Forms Media Element
|
|
|
|
|
pub mod media_element;
|
|
|
|
|
|
2017-04-21 01:53:47 +01:00
|
|
|
/// XEP-0224: Attention
|
|
|
|
|
pub mod attention;
|
|
|
|
|
|
2019-07-31 13:51:18 +02:00
|
|
|
/// XEP-0231: Bits of Binary
|
|
|
|
|
pub mod bob;
|
|
|
|
|
|
2017-04-22 17:39:21 +01:00
|
|
|
/// XEP-0234: Jingle File Transfer
|
|
|
|
|
pub mod jingle_ft;
|
|
|
|
|
|
2019-09-08 15:53:55 +02:00
|
|
|
/// XEP-0257: Client Certificate Management for SASL EXTERNAL
|
|
|
|
|
pub mod cert_management;
|
|
|
|
|
|
2017-05-06 12:49:30 +01:00
|
|
|
/// XEP-0260: Jingle SOCKS5 Bytestreams Transport Method
|
|
|
|
|
pub mod jingle_s5b;
|
|
|
|
|
|
2017-04-22 19:15:48 +01:00
|
|
|
/// XEP-0261: Jingle In-Band Bytestreams Transport Method
|
|
|
|
|
pub mod jingle_ibb;
|
|
|
|
|
|
2024-02-03 23:23:21 +01:00
|
|
|
/// XEP-0264: Jingle Content Thumbnails
|
2024-09-16 17:07:32 -03:00
|
|
|
pub mod jingle_thumbnails;
|
2024-02-03 23:23:21 +01:00
|
|
|
|
2019-07-17 21:55:16 +02:00
|
|
|
/// XEP-0280: Message Carbons
|
|
|
|
|
pub mod carbons;
|
|
|
|
|
|
2019-10-12 19:10:50 +02:00
|
|
|
/// XEP-0293: Jingle RTP Feedback Negotiation
|
|
|
|
|
pub mod jingle_rtcp_fb;
|
|
|
|
|
|
2024-05-13 22:54:26 +02:00
|
|
|
/// XEP-0294: Jingle RTP Header Extensions Negotiation
|
2020-11-27 20:50:30 +01:00
|
|
|
pub mod jingle_rtp_hdrext;
|
|
|
|
|
|
2017-04-29 03:50:49 +01:00
|
|
|
/// XEP-0297: Stanza Forwarding
|
|
|
|
|
pub mod forwarding;
|
|
|
|
|
|
2017-04-21 04:21:16 +01:00
|
|
|
/// XEP-0300: Use of Cryptographic Hash Functions in XMPP
|
|
|
|
|
pub mod hashes;
|
|
|
|
|
|
2022-03-22 16:01:47 +01:00
|
|
|
/// XEP-0301: In-Band Real Time Text
|
|
|
|
|
pub mod rtt;
|
|
|
|
|
|
2017-04-21 02:07:44 +01:00
|
|
|
/// XEP-0308: Last Message Correction
|
|
|
|
|
pub mod message_correct;
|
|
|
|
|
|
2017-04-29 06:07:00 +01:00
|
|
|
/// XEP-0313: Message Archive Management
|
|
|
|
|
pub mod mam;
|
|
|
|
|
|
2017-05-21 20:22:48 +01:00
|
|
|
/// XEP-0319: Last User Interaction in Presence
|
|
|
|
|
pub mod idle;
|
|
|
|
|
|
2019-02-28 13:32:52 +01:00
|
|
|
/// XEP-0320: Use of DTLS-SRTP in Jingle Sessions
|
|
|
|
|
pub mod jingle_dtls_srtp;
|
|
|
|
|
|
2019-09-08 16:09:49 +02:00
|
|
|
/// XEP-0328: JID Prep
|
|
|
|
|
pub mod jid_prep;
|
|
|
|
|
|
2025-04-07 20:16:12 +02:00
|
|
|
/// XEP-0335: JSON Containers
|
|
|
|
|
pub mod json_containers;
|
|
|
|
|
|
2020-11-27 20:54:26 +01:00
|
|
|
/// XEP-0338: Jingle Grouping Framework
|
|
|
|
|
pub mod jingle_grouping;
|
|
|
|
|
|
2019-10-12 18:17:04 +02:00
|
|
|
/// XEP-0339: Source-Specific Media Attributes in Jingle
|
|
|
|
|
pub mod jingle_ssma;
|
|
|
|
|
|
2019-09-07 16:32:03 +02:00
|
|
|
/// XEP-0352: Client State Indication
|
|
|
|
|
pub mod csi;
|
|
|
|
|
|
2017-07-15 11:38:44 +01:00
|
|
|
/// XEP-0353: Jingle Message Initiation
|
|
|
|
|
pub mod jingle_message;
|
|
|
|
|
|
2025-02-22 09:31:02 +02:00
|
|
|
/// XEP-0357: Push Notifications
|
|
|
|
|
pub mod push;
|
|
|
|
|
|
2017-04-29 03:23:50 +01:00
|
|
|
/// XEP-0359: Unique and Stable Stanza IDs
|
|
|
|
|
pub mod stanza_id;
|
|
|
|
|
|
2021-12-25 22:55:36 +01:00
|
|
|
/// XEP-0363: HTTP File Upload
|
|
|
|
|
pub mod http_upload;
|
|
|
|
|
|
2019-03-30 18:47:07 +01:00
|
|
|
/// XEP-0373: OpenPGP for XMPP
|
|
|
|
|
pub mod openpgp;
|
|
|
|
|
|
2024-12-21 17:31:26 +01:00
|
|
|
/// XEP-0377: Spam Reporting
|
|
|
|
|
pub mod spam_reporting;
|
|
|
|
|
|
2017-04-21 03:45:05 +01:00
|
|
|
/// XEP-0380: Explicit Message Encryption
|
|
|
|
|
pub mod eme;
|
|
|
|
|
|
2022-03-30 18:40:16 +02:00
|
|
|
/// XEP-0380: OMEMO Encryption (experimental version 0.3.0)
|
|
|
|
|
pub mod legacy_omemo;
|
|
|
|
|
|
2024-07-01 19:08:22 +02:00
|
|
|
/// XEP-0386: Bind 2
|
|
|
|
|
pub mod bind2;
|
|
|
|
|
|
2024-07-02 09:39:24 +02:00
|
|
|
/// XEP-0388: Extensible SASL Profile
|
|
|
|
|
pub mod sasl2;
|
|
|
|
|
|
2017-04-21 01:06:30 +01:00
|
|
|
/// XEP-0390: Entity Capabilities 2.0
|
|
|
|
|
pub mod ecaps2;
|
2019-07-17 17:30:52 +02:00
|
|
|
|
2022-01-03 12:34:24 +01:00
|
|
|
/// XEP-0402: PEP Native Bookmarks
|
2019-09-29 01:47:21 +02:00
|
|
|
pub mod bookmarks2;
|
|
|
|
|
|
2019-07-17 17:30:52 +02:00
|
|
|
/// XEP-0421: Anonymous unique occupant identifiers for MUCs
|
|
|
|
|
pub mod occupant_id;
|
2021-09-29 20:08:08 +02:00
|
|
|
|
|
|
|
|
/// XEP-0441: Message Archive Management Preferences
|
|
|
|
|
pub mod mam_prefs;
|
2022-12-30 15:16:33 +01:00
|
|
|
|
2024-07-02 18:40:28 +02:00
|
|
|
/// XEP-0440: SASL Channel-Binding Type Capability
|
|
|
|
|
pub mod sasl_cb;
|
|
|
|
|
|
2022-12-30 15:16:33 +01:00
|
|
|
/// XEP-0444: Message Reactions
|
|
|
|
|
pub mod reactions;
|
2024-06-30 18:07:00 +02:00
|
|
|
|
2024-08-03 13:21:52 +02:00
|
|
|
/// XEP-0478: Stream Limits Advertisement
|
|
|
|
|
pub mod stream_limits;
|
|
|
|
|
|
2024-06-30 18:07:00 +02:00
|
|
|
/// XEP-0484: Fast Authentication Streamlining Tokens
|
|
|
|
|
pub mod fast;
|
2024-12-15 16:10:45 +01:00
|
|
|
|
|
|
|
|
/// XEP-0490: Message Displayed Synchronization
|
|
|
|
|
pub mod message_displayed;
|
2024-12-18 17:59:06 +01:00
|
|
|
|
2026-01-09 00:31:34 +01:00
|
|
|
/// XEP-0494: Client Access Management
|
|
|
|
|
pub mod cam;
|
|
|
|
|
|
2026-02-10 13:20:19 +01:00
|
|
|
/// XEP-0507: Jingle Content Category
|
|
|
|
|
pub mod jingle_content;
|
|
|
|
|
|
2024-12-18 17:59:06 +01:00
|
|
|
#[cfg(test)]
|
|
|
|
|
mod tests {
|
|
|
|
|
#[test]
|
|
|
|
|
fn reexports() {
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::blake2;
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::jid;
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::minidom;
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::sha1;
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::sha2;
|
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
|
use crate::sha3;
|
|
|
|
|
}
|
|
|
|
|
}
|