From 88ab74c92f82c0707d4a6d1294103123e8d4fc3a Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Mon, 20 Mar 2023 17:27:13 +0100 Subject: [PATCH] Set tokio_xmpp::client::async_client::Config as public --- tokio-xmpp/src/client/async_client.rs | 16 ++++++++++++---- tokio-xmpp/src/lib.rs | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tokio-xmpp/src/client/async_client.rs b/tokio-xmpp/src/client/async_client.rs index dc629932..2d233ff5 100644 --- a/tokio-xmpp/src/client/async_client.rs +++ b/tokio-xmpp/src/client/async_client.rs @@ -35,21 +35,29 @@ pub struct Client { } /// XMPP server connection configuration -#[derive(Clone)] +#[derive(Clone, Debug)] pub enum ServerConfig { + /// Use SRV record to find server host UseSrv, #[allow(unused)] + /// Manually define server host and port Manual { + /// Server host name host: String, + /// Server port port: u16, }, } /// XMMPP client configuration +#[derive(Clone, Debug)] pub struct Config { - jid: Jid, - password: String, - server: ServerConfig, + /// jid of the account + pub jid: Jid, + /// password of the account + pub password: String, + /// server configuration for the account + pub server: ServerConfig, } type XMPPStream = xmpp_stream::XMPPStream>; diff --git a/tokio-xmpp/src/lib.rs b/tokio-xmpp/src/lib.rs index aaf65b24..57d3e002 100644 --- a/tokio-xmpp/src/lib.rs +++ b/tokio-xmpp/src/lib.rs @@ -12,7 +12,10 @@ mod client; mod happy_eyeballs; pub mod stream_features; pub mod xmpp_stream; -pub use client::{async_client::Client as AsyncClient, simple_client::Client as SimpleClient}; +pub use client::{ + async_client::Client as AsyncClient, async_client::Config as AsyncConfig, + async_client::ServerConfig as AsyncServerConfig, simple_client::Client as SimpleClient, +}; mod component; pub use crate::component::Component; mod error;