luz/src/lib.rs

29 lines
580 B
Rust
Raw Normal View History

2023-06-16 14:49:20 +01:00
#![allow(unused_must_use)]
2023-10-28 21:06:42 +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
pub use connection::Connection;
2024-11-23 22:39:44 +00:00
pub use error::Error;
2023-06-19 19:23:54 +01:00
pub use jabber::Jabber;
pub use jid::JID;
2023-06-16 14:49:20 +01:00
2024-11-23 22:39:44 +00:00
pub type Result<T> = std::result::Result<T, Error>;
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
}
}