summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 86da83d..738735d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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();
}
}