From e893869df974ebb7afcc318119840c53f8f377cb Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Sat, 21 Oct 2023 01:28:54 +0100 Subject: implement connection --- src/lib.rs | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 86da83d..738735d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,38 +2,30 @@ #![feature(let_chains)] // TODO: logging (dropped errors) -pub mod client; +pub mod connection; pub mod error; pub mod jabber; pub mod jid; pub mod stanza; -// pub use client::encrypted::JabberClient; +#[macro_use] +extern crate lazy_static; + +pub use connection::Connection; pub use error::JabberError; pub use jabber::Jabber; pub use jid::JID; pub type Result = std::result::Result; +pub async fn login, P: AsRef>(jid: J, password: P) -> Result { + todo!() +} + #[cfg(test)] mod tests { - use std::str::FromStr; - - use crate::Jabber; - use crate::JID; - #[tokio::test] - async fn login() { - Jabber::user( - JID::from_str("test@blos.sm/clown").unwrap(), - "slayed".to_owned(), - ) - .unwrap() - .login() - .await - .unwrap() - .watch() - .await - .unwrap(); + async fn test_login() { + crate::login("test@blos.sm/clown", "slayed").await.unwrap(); } } -- cgit