luz/src/lib.rs

32 lines
629 B
Rust
Raw Normal View History

2023-06-16 14:49:20 +01:00
#![allow(unused_must_use)]
2023-08-02 00:56:38 +01:00
#![feature(let_chains)]
2023-06-16 14:49:20 +01:00
2023-06-19 19:23:54 +01:00
// TODO: logging (dropped errors)
2023-10-21 01:28:54 +01:00
pub mod connection;
2023-06-19 19:23:54 +01:00
pub mod error;
pub mod jabber;
2023-06-16 17:13:01 +01:00
pub mod jid;
2023-06-19 19:23:54 +01:00
pub mod stanza;
2023-06-13 00:46:59 +01:00
2023-10-21 01:28:54 +01:00
#[macro_use]
extern crate lazy_static;
pub use connection::Connection;
2023-06-19 19:23:54 +01:00
pub use error::JabberError;
pub use jabber::Jabber;
pub use jid::JID;
2023-06-16 14:49:20 +01:00
2023-06-19 19:23:54 +01:00
pub type Result<T> = std::result::Result<T, JabberError>;
2023-06-13 00:46:59 +01:00
2023-10-21 01:28:54 +01:00
pub async fn login<J: TryInto<JID>, P: AsRef<str>>(jid: J, password: P) -> Result<Connection> {
todo!()
}
2023-06-13 00:46:59 +01:00
#[cfg(test)]
mod tests {
2023-06-16 17:13:01 +01:00
#[tokio::test]
2023-10-21 01:28:54 +01:00
async fn test_login() {
crate::login("test@blos.sm/clown", "slayed").await.unwrap();
2023-06-13 00:46:59 +01:00
}
}