From 0b58561003caecfa5eccbf45937ddb8fb59b3bac Mon Sep 17 00:00:00 2001 From: xmppftw Date: Tue, 6 Aug 2024 21:00:11 +0200 Subject: [PATCH] Rename AsyncClient to Client --- tokio-xmpp/ChangeLog | 1 + tokio-xmpp/examples/contact_addr.rs | 2 +- tokio-xmpp/examples/download_avatars.rs | 2 +- tokio-xmpp/examples/echo_bot.rs | 2 +- tokio-xmpp/src/connect/starttls.rs | 4 ++-- tokio-xmpp/src/connect/tcp.rs | 9 ++++++--- tokio-xmpp/src/lib.rs | 2 +- xmpp/src/agent.rs | 2 +- xmpp/src/builder.rs | 2 +- xmpp/src/lib.rs | 2 +- 10 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tokio-xmpp/ChangeLog b/tokio-xmpp/ChangeLog index 04a32b0f..1b8180be 100644 --- a/tokio-xmpp/ChangeLog +++ b/tokio-xmpp/ChangeLog @@ -22,6 +22,7 @@ XXXX-YY-ZZ RELEASER - `Component` and `Client` now have `new_plaintext`, `new_starttls` and `new_with_connector` methods with same signature (!428) `new_plaintext` and `new_starttls` take a DnsConfig struct for SRV/DNS resolution strategy, while `new_with_connector` takes anything that implements ServerConnector + - `tokio_xmpp::AsyncClient` has been renamed `tokio_xmpp::Client` (!428) Version 4.0.0: 2024-07-26 Maxime “pep” Buquet diff --git a/tokio-xmpp/examples/contact_addr.rs b/tokio-xmpp/examples/contact_addr.rs index 1c10f292..b473b11f 100644 --- a/tokio-xmpp/examples/contact_addr.rs +++ b/tokio-xmpp/examples/contact_addr.rs @@ -3,7 +3,7 @@ use minidom::Element; use std::env::args; use std::process::exit; use std::str::FromStr; -use tokio_xmpp::AsyncClient as Client; +use tokio_xmpp::Client; use xmpp_parsers::{ disco::{DiscoInfoQuery, DiscoInfoResult}, iq::{Iq, IqType}, diff --git a/tokio-xmpp/examples/download_avatars.rs b/tokio-xmpp/examples/download_avatars.rs index 945ee56c..da818dce 100644 --- a/tokio-xmpp/examples/download_avatars.rs +++ b/tokio-xmpp/examples/download_avatars.rs @@ -5,7 +5,7 @@ use std::fs::{create_dir_all, File}; use std::io::{self, Write}; use std::process::exit; use std::str::FromStr; -use tokio_xmpp::AsyncClient as Client; +use tokio_xmpp::Client; use xmpp_parsers::{ avatar::{Data as AvatarData, Metadata as AvatarMetadata}, caps::{compute_disco, hash_caps, Caps}, diff --git a/tokio-xmpp/examples/echo_bot.rs b/tokio-xmpp/examples/echo_bot.rs index 3dcf3693..9810c598 100644 --- a/tokio-xmpp/examples/echo_bot.rs +++ b/tokio-xmpp/examples/echo_bot.rs @@ -3,7 +3,7 @@ use minidom::Element; use std::env::args; use std::process::exit; use std::str::FromStr; -use tokio_xmpp::AsyncClient as Client; +use tokio_xmpp::Client; use xmpp_parsers::jid::{BareJid, Jid}; use xmpp_parsers::message::{Body, Message, MessageType}; use xmpp_parsers::presence::{Presence, Show as PresenceShow, Type as PresenceType}; diff --git a/tokio-xmpp/src/connect/starttls.rs b/tokio-xmpp/src/connect/starttls.rs index 8aa51b92..93418530 100644 --- a/tokio-xmpp/src/connect/starttls.rs +++ b/tokio-xmpp/src/connect/starttls.rs @@ -40,11 +40,11 @@ use crate::{ connect::{DnsConfig, ServerConnector, ServerConnectorError}, error::{Error, ProtocolError}, proto::{Packet, XmppStream}, - AsyncClient, Component, + Client, Component, }; /// Client that connects over StartTls -pub type StartTlsClient = AsyncClient; +pub type StartTlsClient = Client; /// Component that connects over StartTls pub type StartTlsComponent = Component; diff --git a/tokio-xmpp/src/connect/tcp.rs b/tokio-xmpp/src/connect/tcp.rs index 9f612303..21061cf6 100644 --- a/tokio-xmpp/src/connect/tcp.rs +++ b/tokio-xmpp/src/connect/tcp.rs @@ -2,14 +2,17 @@ use tokio::net::TcpStream; -use crate::connect::DnsConfig; -use crate::{connect::ServerConnector, proto::XmppStream, AsyncClient, Component, Error}; +use crate::{ + connect::{DnsConfig, ServerConnector}, + proto::XmppStream, + Client, Component, Error, +}; /// Component that connects over TCP pub type TcpComponent = Component; /// Client that connects over TCP -pub type TcpClient = AsyncClient; +pub type TcpClient = Client; /// Connect via insecure plaintext TCP to an XMPP server /// This should only be used over localhost or otherwise when you know what you are doing diff --git a/tokio-xmpp/src/lib.rs b/tokio-xmpp/src/lib.rs index b229cf40..1709931f 100644 --- a/tokio-xmpp/src/lib.rs +++ b/tokio-xmpp/src/lib.rs @@ -26,7 +26,7 @@ mod client; pub mod connect; pub mod proto; -pub use client::async_client::Client as AsyncClient; +pub use client::async_client::Client; mod component; pub use crate::component::Component; /// Detailed error types diff --git a/xmpp/src/agent.rs b/xmpp/src/agent.rs index 5331fef3..aef18bbc 100644 --- a/xmpp/src/agent.rs +++ b/xmpp/src/agent.rs @@ -13,7 +13,7 @@ use tokio_xmpp::parsers::{disco::DiscoInfoResult, message::MessageType}; pub use tokio_xmpp::{ jid::{BareJid, FullJid, Jid}, minidom::Element, - AsyncClient as TokioXmppClient, + Client as TokioXmppClient, }; use crate::{event_loop, message, muc, upload, Error, Event, RoomNick}; diff --git a/xmpp/src/builder.rs b/xmpp/src/builder.rs index 5f28541b..8b0e769d 100644 --- a/xmpp/src/builder.rs +++ b/xmpp/src/builder.rs @@ -15,7 +15,7 @@ use tokio_xmpp::{ disco::{DiscoInfoResult, Feature, Identity}, ns, }, - AsyncClient as TokioXmppClient, + Client as TokioXmppClient, }; use crate::{Agent, ClientFeature}; diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index f7b5a2fb..3a9f238e 100644 --- a/xmpp/src/lib.rs +++ b/xmpp/src/lib.rs @@ -43,7 +43,7 @@ mod tests { use super::jid::BareJid; use super::{ClientBuilder, ClientFeature, ClientType, Event}; use std::str::FromStr; - use tokio_xmpp::AsyncClient as TokioXmppClient; + use tokio_xmpp::Client as TokioXmppClient; #[tokio::test] async fn test_simple() {