tokio_xmpp/connect/
mod.rsuse sasl::common::ChannelBinding;
use tokio::io::{AsyncBufRead, AsyncWrite};
use xmpp_parsers::jid::Jid;
use crate::xmlstream::{PendingFeaturesRecv, Timeouts};
use crate::Error;
#[cfg(feature = "starttls")]
pub mod starttls;
#[cfg(feature = "starttls")]
pub use starttls::StartTlsServerConnector;
#[cfg(feature = "insecure-tcp")]
pub mod tcp;
#[cfg(feature = "insecure-tcp")]
pub use tcp::TcpServerConnector;
mod dns;
pub use dns::DnsConfig;
pub trait AsyncReadAndWrite: AsyncBufRead + AsyncWrite + Unpin + Send {}
impl<T: AsyncBufRead + AsyncWrite + Unpin + Send> AsyncReadAndWrite for T {}
pub trait ServerConnectorError: std::error::Error + Sync + Send {}
pub trait ServerConnector: Clone + core::fmt::Debug + Send + Unpin + 'static {
type Stream: AsyncReadAndWrite;
fn connect(
&self,
jid: &Jid,
ns: &'static str,
timeouts: Timeouts,
) -> impl std::future::Future<
Output = Result<(PendingFeaturesRecv<Self::Stream>, ChannelBinding), Error>,
> + Send;
}