diff options
author | 2025-03-26 14:29:40 +0000 | |
---|---|---|
committer | 2025-03-26 14:29:40 +0000 | |
commit | 2211f324782cdc617b4b5ecd071178e372539fe4 (patch) | |
tree | a5ea5ce11d748424447dee23173d3cb8aec648ea /jabber | |
parent | 2f8671978e18c1e1e7834056ae674f32fbde3868 (diff) | |
download | luz-2211f324782cdc617b4b5ecd071178e372539fe4.tar.gz luz-2211f324782cdc617b4b5ecd071178e372539fe4.tar.bz2 luz-2211f324782cdc617b4b5ecd071178e372539fe4.zip |
refactor: rename crates and move client logic to separate crate `filament`
Diffstat (limited to '')
-rw-r--r-- | jabber/Cargo.toml | 42 | ||||
-rw-r--r-- | jabber/src/error.rs | 58 | ||||
-rw-r--r-- | jabber/src/lib.rs | 25 | ||||
-rw-r--r-- | luz/Cargo.lock (renamed from jabber/Cargo.lock) | 0 | ||||
-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 |
8 files changed, 0 insertions, 125 deletions
diff --git a/jabber/Cargo.toml b/jabber/Cargo.toml deleted file mode 100644 index fbb776b..0000000 --- a/jabber/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "jabber" -authors = ["cel <cel@bunny.garden>"] -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -async-recursion = "1.0.4" -async-trait = "0.1.68" -lazy_static = "1.4.0" -nanoid = "0.4.0" -# TODO: remove unneeded features and dependencies -rsasl = { version = "2.0.1", default_features = false, features = [ - "provider_base64", - "plain", - "config_builder", - "scram-sha-1", -] } -tokio = { version = "1.28", features = ["full"] } -tokio-native-tls = "0.3.1" -tracing = "0.1.40" -trust-dns-resolver = "0.22.0" -try_map = "0.3.1" -stanza = { version = "0.1.0", path = "../stanza" } -peanuts = { version = "0.1.0", path = "../../peanuts" } -jid = { version = "0.1.0", path = "../jid" } -futures = "0.3.31" -take_mut = "0.2.2" -pin-project-lite = "0.2.15" -pin-project = "1.1.7" -thiserror = "2.0.11" - -[dev-dependencies] -test-log = { version = "0.2", features = ["trace"] } -env_logger = "*" -tracing-subscriber = { version = "0.3", default-features = false, features = [ - "env-filter", - "fmt", -] } -stanza = { version = "0.1.0", path = "../stanza", features = ["xep_0199"] } 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/Cargo.lock b/luz/Cargo.lock index d45d7c1..d45d7c1 100644 --- a/jabber/Cargo.lock +++ b/luz/Cargo.lock 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 |