diff options
author | 2024-12-04 18:18:37 +0000 | |
---|---|---|
committer | 2024-12-04 18:18:37 +0000 | |
commit | 1b91ff690488b65b552c90bd5392b9a300c8c981 (patch) | |
tree | 9c290f69b26eba0393d7bbc05ba29c28ea74a26e /jabber/src/lib.rs | |
parent | 03764f8cedb3f0a55a61be0f0a59faaa6357a83a (diff) | |
download | luz-1b91ff690488b65b552c90bd5392b9a300c8c981.tar.gz luz-1b91ff690488b65b552c90bd5392b9a300c8c981.tar.bz2 luz-1b91ff690488b65b552c90bd5392b9a300c8c981.zip |
use cargo workspace
Diffstat (limited to 'jabber/src/lib.rs')
-rw-r--r-- | jabber/src/lib.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/jabber/src/lib.rs b/jabber/src/lib.rs new file mode 100644 index 0000000..bcd63db --- /dev/null +++ b/jabber/src/lib.rs @@ -0,0 +1,34 @@ +#![allow(unused_must_use)] +// #![feature(let_chains)] + +// TODO: logging (dropped errors) +pub mod client; +pub mod connection; +pub mod error; +pub mod jabber_stream; + +pub use connection::Connection; +use connection::Tls; +pub use error::Error; +pub use jabber_stream::JabberStream; +pub use jid::JID; + +pub type Result<T> = std::result::Result<T, Error>; + +pub async fn login<J: AsRef<str>, P: AsRef<str>>(jid: J, password: P) -> Result<JabberStream<Tls>> { + todo!() + // Ok(Connection::connect_user(jid, password.as_ref().to_string()) + // .await? + // .ensure_tls() + // .await? + // .negotiate() + // .await?) +} + +#[cfg(test)] +mod tests { + // #[tokio::test] + // async fn test_login() { + // crate::login("test@blos.sm/clown", "slayed").await.unwrap(); + // } +} |