diff options
author | cel 🌸 <cel@blos.sm> | 2023-10-21 01:28:54 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2023-10-21 01:28:54 +0100 |
commit | e893869df974ebb7afcc318119840c53f8f377cb (patch) | |
tree | 3319dba477784c126011acc5422c9973782f7850 /src/lib.rs | |
parent | ba94ee66fafbabd63d6d1ed5edf435d4c46c6796 (diff) | |
download | luz-e893869df974ebb7afcc318119840c53f8f377cb.tar.gz luz-e893869df974ebb7afcc318119840c53f8f377cb.tar.bz2 luz-e893869df974ebb7afcc318119840c53f8f377cb.zip |
implement connection
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 30 |
1 files changed, 11 insertions, 19 deletions
@@ -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<T> = std::result::Result<T, JabberError>; +pub async fn login<J: TryInto<JID>, P: AsRef<str>>(jid: J, password: P) -> Result<Connection> { + 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(); } } |