aboutsummaryrefslogtreecommitdiffstats
path: root/jabber/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--jabber/src/error.rs58
-rw-r--r--jabber/src/lib.rs25
-rw-r--r--luz/src/client.rs (renamed from jabber/src/client.rs)0
-rw-r--r--luz/src/connection.rs (renamed from jabber/src/connection.rs)0
-rw-r--r--luz/src/jabber_stream.rs (renamed from jabber/src/jabber_stream.rs)0
-rw-r--r--luz/src/jabber_stream/bound_stream.rs (renamed from jabber/src/jabber_stream/bound_stream.rs)0
6 files changed, 0 insertions, 83 deletions
diff --git a/jabber/src/error.rs b/jabber/src/error.rs
deleted file mode 100644
index ec60778..0000000
--- a/jabber/src/error.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-use std::str::Utf8Error;
-use std::sync::Arc;
-
-use jid::ParseError;
-use rsasl::mechname::MechanismNameError;
-use stanza::client::error::Error as ClientError;
-use stanza::sasl::Failure;
-use stanza::stream::Error as StreamError;
-use thiserror::Error;
-
-#[derive(Error, Debug, Clone)]
-pub enum Error {
- #[error("connection")]
- Connection,
- #[error("utf8 decode: {0}")]
- Utf8Decode(#[from] Utf8Error),
- #[error("negotiation")]
- Negotiation,
- #[error("tls required")]
- TlsRequired,
- #[error("already connected with tls")]
- AlreadyTls,
- // TODO: specify unsupported feature
- #[error("unsupported feature")]
- Unsupported,
- #[error("jid missing localpart")]
- NoLocalpart,
- #[error("received unexpected element: {0:?}")]
- UnexpectedElement(peanuts::Element),
- #[error("xml error: {0}")]
- XML(#[from] peanuts::Error),
- #[error("sasl error: {0}")]
- SASL(#[from] SASLError),
- #[error("jid error: {0}")]
- JID(#[from] ParseError),
- #[error("client stanza error: {0}")]
- ClientError(#[from] ClientError),
- #[error("stream error: {0}")]
- StreamError(#[from] StreamError),
- #[error("error missing")]
- MissingError,
-}
-
-#[derive(Error, Debug, Clone)]
-pub enum SASLError {
- #[error("sasl error: {0}")]
- SASL(Arc<rsasl::prelude::SASLError>),
- #[error("mechanism error: {0}")]
- MechanismName(#[from] MechanismNameError),
- #[error("authentication failure: {0}")]
- Authentication(#[from] Failure),
-}
-
-impl From<rsasl::prelude::SASLError> for SASLError {
- fn from(e: rsasl::prelude::SASLError) -> Self {
- Self::SASL(Arc::new(e))
- }
-}
diff --git a/jabber/src/lib.rs b/jabber/src/lib.rs
deleted file mode 100644
index 8855ca7..0000000
--- a/jabber/src/lib.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-#![allow(unused_must_use)]
-// #![feature(let_chains)]
-
-// TODO: logging (dropped errors)
-pub mod client;
-pub mod connection;
-pub mod error;
-pub mod jabber_stream;
-
-pub use connection::Connection;
-pub use error::Error;
-pub use jabber_stream::JabberStream;
-pub use jid::JID;
-
-pub type Result<T> = std::result::Result<T, Error>;
-
-pub use client::connect_and_login;
-
-#[cfg(test)]
-mod tests {
- // #[tokio::test]
- // async fn test_login() {
- // crate::login("test@blos.sm/clown", "slayed").await.unwrap();
- // }
-}
diff --git a/jabber/src/client.rs b/luz/src/client.rs
index de2be08..de2be08 100644
--- a/jabber/src/client.rs
+++ b/luz/src/client.rs
diff --git a/jabber/src/connection.rs b/luz/src/connection.rs
index b185eca..b185eca 100644
--- a/jabber/src/connection.rs
+++ b/luz/src/connection.rs
diff --git a/jabber/src/jabber_stream.rs b/luz/src/jabber_stream.rs
index 302350d..302350d 100644
--- a/jabber/src/jabber_stream.rs
+++ b/luz/src/jabber_stream.rs
diff --git a/jabber/src/jabber_stream/bound_stream.rs b/luz/src/jabber_stream/bound_stream.rs
index 25b79ff..25b79ff 100644
--- a/jabber/src/jabber_stream/bound_stream.rs
+++ b/luz/src/jabber_stream/bound_stream.rs