Rename AsyncClient to Client

This commit is contained in:
xmppftw xmppftw 2024-08-06 21:00:11 +02:00
commit 0b58561003
10 changed files with 16 additions and 12 deletions

View file

@ -22,6 +22,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
- `Component` and `Client` now have `new_plaintext`, `new_starttls` and `new_with_connector` methods with same signature (!428) - `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 `new_plaintext` and `new_starttls` take a DnsConfig struct for SRV/DNS resolution strategy, while `new_with_connector` takes
anything that implements ServerConnector anything that implements ServerConnector
- `tokio_xmpp::AsyncClient` has been renamed `tokio_xmpp::Client` (!428)
Version 4.0.0: Version 4.0.0:
2024-07-26 Maxime “pep” Buquet <pep@bouah.net> 2024-07-26 Maxime “pep” Buquet <pep@bouah.net>

View file

@ -3,7 +3,7 @@ use minidom::Element;
use std::env::args; use std::env::args;
use std::process::exit; use std::process::exit;
use std::str::FromStr; use std::str::FromStr;
use tokio_xmpp::AsyncClient as Client; use tokio_xmpp::Client;
use xmpp_parsers::{ use xmpp_parsers::{
disco::{DiscoInfoQuery, DiscoInfoResult}, disco::{DiscoInfoQuery, DiscoInfoResult},
iq::{Iq, IqType}, iq::{Iq, IqType},

View file

@ -5,7 +5,7 @@ use std::fs::{create_dir_all, File};
use std::io::{self, Write}; use std::io::{self, Write};
use std::process::exit; use std::process::exit;
use std::str::FromStr; use std::str::FromStr;
use tokio_xmpp::AsyncClient as Client; use tokio_xmpp::Client;
use xmpp_parsers::{ use xmpp_parsers::{
avatar::{Data as AvatarData, Metadata as AvatarMetadata}, avatar::{Data as AvatarData, Metadata as AvatarMetadata},
caps::{compute_disco, hash_caps, Caps}, caps::{compute_disco, hash_caps, Caps},

View file

@ -3,7 +3,7 @@ use minidom::Element;
use std::env::args; use std::env::args;
use std::process::exit; use std::process::exit;
use std::str::FromStr; use std::str::FromStr;
use tokio_xmpp::AsyncClient as Client; use tokio_xmpp::Client;
use xmpp_parsers::jid::{BareJid, Jid}; use xmpp_parsers::jid::{BareJid, Jid};
use xmpp_parsers::message::{Body, Message, MessageType}; use xmpp_parsers::message::{Body, Message, MessageType};
use xmpp_parsers::presence::{Presence, Show as PresenceShow, Type as PresenceType}; use xmpp_parsers::presence::{Presence, Show as PresenceShow, Type as PresenceType};

View file

@ -40,11 +40,11 @@ use crate::{
connect::{DnsConfig, ServerConnector, ServerConnectorError}, connect::{DnsConfig, ServerConnector, ServerConnectorError},
error::{Error, ProtocolError}, error::{Error, ProtocolError},
proto::{Packet, XmppStream}, proto::{Packet, XmppStream},
AsyncClient, Component, Client, Component,
}; };
/// Client that connects over StartTls /// Client that connects over StartTls
pub type StartTlsClient = AsyncClient<StartTlsServerConnector>; pub type StartTlsClient = Client<StartTlsServerConnector>;
/// Component that connects over StartTls /// Component that connects over StartTls
pub type StartTlsComponent = Component<StartTlsServerConnector>; pub type StartTlsComponent = Component<StartTlsServerConnector>;

View file

@ -2,14 +2,17 @@
use tokio::net::TcpStream; use tokio::net::TcpStream;
use crate::connect::DnsConfig; use crate::{
use crate::{connect::ServerConnector, proto::XmppStream, AsyncClient, Component, Error}; connect::{DnsConfig, ServerConnector},
proto::XmppStream,
Client, Component, Error,
};
/// Component that connects over TCP /// Component that connects over TCP
pub type TcpComponent = Component<TcpServerConnector>; pub type TcpComponent = Component<TcpServerConnector>;
/// Client that connects over TCP /// Client that connects over TCP
pub type TcpClient = AsyncClient<TcpServerConnector>; pub type TcpClient = Client<TcpServerConnector>;
/// Connect via insecure plaintext TCP to an XMPP server /// 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 /// This should only be used over localhost or otherwise when you know what you are doing

View file

@ -26,7 +26,7 @@ mod client;
pub mod connect; pub mod connect;
pub mod proto; pub mod proto;
pub use client::async_client::Client as AsyncClient; pub use client::async_client::Client;
mod component; mod component;
pub use crate::component::Component; pub use crate::component::Component;
/// Detailed error types /// Detailed error types

View file

@ -13,7 +13,7 @@ use tokio_xmpp::parsers::{disco::DiscoInfoResult, message::MessageType};
pub use tokio_xmpp::{ pub use tokio_xmpp::{
jid::{BareJid, FullJid, Jid}, jid::{BareJid, FullJid, Jid},
minidom::Element, minidom::Element,
AsyncClient as TokioXmppClient, Client as TokioXmppClient,
}; };
use crate::{event_loop, message, muc, upload, Error, Event, RoomNick}; use crate::{event_loop, message, muc, upload, Error, Event, RoomNick};

View file

@ -15,7 +15,7 @@ use tokio_xmpp::{
disco::{DiscoInfoResult, Feature, Identity}, disco::{DiscoInfoResult, Feature, Identity},
ns, ns,
}, },
AsyncClient as TokioXmppClient, Client as TokioXmppClient,
}; };
use crate::{Agent, ClientFeature}; use crate::{Agent, ClientFeature};

View file

@ -43,7 +43,7 @@ mod tests {
use super::jid::BareJid; use super::jid::BareJid;
use super::{ClientBuilder, ClientFeature, ClientType, Event}; use super::{ClientBuilder, ClientFeature, ClientType, Event};
use std::str::FromStr; use std::str::FromStr;
use tokio_xmpp::AsyncClient as TokioXmppClient; use tokio_xmpp::Client as TokioXmppClient;
#[tokio::test] #[tokio::test]
async fn test_simple() { async fn test_simple() {