Crate tokio_xmpp

Source
Expand description

Low-level XMPP decentralized instant messaging & social networking implementation with asynchronous I/O using tokio.

For an easier, batteries-included experience, try the xmpp crate.

§Getting started

In most cases, you want to start with a Client, that will connect to a server over TCP/IP with StartTLS encryption. Then, you can build an event loop by calling the client’s next method repeatedly. You can find a more complete example in the examples/echo_bot.rs file in the repository.

§Features

This library is not feature-complete yet. Here’s a quick overview of the feature set.

Supported implementations:

  • Clients
  • Components
  • Servers

Supported transports:

§Cargo features

§TLS backends

  • aws_lc_rs (default) enables rustls with the aws_lc_rs backend.
  • ring enables rustls with the ring backend`.
  • rustls-any-backend enables rustls, but without enabling a backend. It is the application’s responsibility to ensure that a backend is enabled and installed.
  • ktls enables the use of ktls. Important: Currently, connections will fail if the tls kernel module is not available. There is no fallback to non-ktls connections!
  • native-tls enables the system-native TLS library (commonly libssl/OpenSSL).

Note: It is not allowed to mix rustls-based TLS backends with tls-native. Attempting to do so will result in a compilation error.

Note: The ktls feature requires at least one rustls backend to be enabled (aws_lc_rs or ring).

Note: When enabling not exactly one rustls backend, it is the application’s responsibility to make sure that a default crypto provider is installed in rustls. Otherwise, all TLS connections will fail.

§Certificate validation

When using native-tls, the system’s native certificate store is used. Otherwise, you need to pick one of the following to ensure that TLS connections will succeed:

§Other features

  • starttls (default): Enables support for <starttls/>. Required as per RFC 6120.
  • insecure-tcp: Allow the use of insecure TCP connections to connect to XMPP servers. Required for XMPP components, but disabled by default to prevent accidental use.
  • serde: Enable the serde feature in xmpp-parsers.
  • component: Enable component support (implies insecure-tcp).

§More information

You can find more information on our website xmpp.rs or by joining our chatroom chat@xmpp.rs.

Re-exports§

pub use parsers::jid;
pub use parsers::minidom;
pub use xmpp_parsers as parsers;
pub use tokio_rustls::rustls;ring or aws_lc_rs or ktls

Modules§

connect
ServerConnector provides streams for XMPP clients
error
Detailed error types
stanzastream
Resilient stanza stream
xmlstream
RFC 6120 XML Streams

Structs§

Client
XMPP client connection and state
Componentinsecure-tcp
Component connection to an XMPP server
IqResponseToken
Handle for awaiting an IQ response.
PrintRawXml
Provides a helper which implements Display printing raw XML

Enums§

Error
Generic tokio_xmpp Error Top-level error type
Event
High-level event on the Stream implemented by Client and Component
IqFailure
Error enumeration for Iq sending failures
IqRequest
An IQ request payload
IqResponse
An IQ response payload
Stanza
A stanza sent/received over the stream.