summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-10-21 01:28:54 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-10-21 01:28:54 +0100
commite893869df974ebb7afcc318119840c53f8f377cb (patch)
tree3319dba477784c126011acc5422c9973782f7850 /src/lib.rs
parentba94ee66fafbabd63d6d1ed5edf435d4c46c6796 (diff)
downloadluz-e893869df974ebb7afcc318119840c53f8f377cb.tar.gz
luz-e893869df974ebb7afcc318119840c53f8f377cb.tar.bz2
luz-e893869df974ebb7afcc318119840c53f8f377cb.zip
implement connection
Diffstat (limited to '')
-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();
}
}