summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
blob: 738735d5bfa8cce95afda64be41a9b4176c4dd67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![allow(unused_must_use)]
#![feature(let_chains)]

// TODO: logging (dropped errors)
pub mod connection;
pub mod error;
pub mod jabber;
pub mod jid;
pub mod stanza;

#[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 {
    #[tokio::test]
    async fn test_login() {
        crate::login("test@blos.sm/clown", "slayed").await.unwrap();
    }
}