From 1b91ff690488b65b552c90bd5392b9a300c8c981 Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Wed, 4 Dec 2024 18:18:37 +0000 Subject: use cargo workspace --- src/error.rs | 78 ------------------------------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 src/error.rs (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 8875ebb..0000000 --- a/src/error.rs +++ /dev/null @@ -1,78 +0,0 @@ -use std::str::Utf8Error; - -use rsasl::mechname::MechanismNameError; - -use crate::stanza::client::error::Error as ClientError; -use crate::stanza::stream::Error as StreamError; -use crate::{jid::ParseError, stanza::sasl::Failure}; - -#[derive(Debug)] -pub enum Error { - Connection, - Utf8Decode, - Negotiation, - TlsRequired, - AlreadyTls, - Unsupported, - NoLocalpart, - AlreadyConnecting, - UnexpectedElement(peanuts::Element), - XML(peanuts::Error), - Deserialization(peanuts::DeserializeError), - SASL(SASLError), - JID(ParseError), - Authentication(Failure), - ClientError(ClientError), - StreamError(StreamError), - MissingError, - Disconnected, - Connecting, -} - -#[derive(Debug)] -pub enum SASLError { - SASL(rsasl::prelude::SASLError), - MechanismName(MechanismNameError), -} - -impl From for Error { - fn from(e: rsasl::prelude::SASLError) -> Self { - Self::SASL(SASLError::SASL(e)) - } -} - -impl From for Error { - fn from(e: peanuts::DeserializeError) -> Self { - Error::Deserialization(e) - } -} - -impl From for Error { - fn from(e: MechanismNameError) -> Self { - Self::SASL(SASLError::MechanismName(e)) - } -} - -impl From for Error { - fn from(e: SASLError) -> Self { - Self::SASL(e) - } -} - -impl From for Error { - fn from(_e: Utf8Error) -> Self { - Self::Utf8Decode - } -} - -impl From for Error { - fn from(e: peanuts::Error) -> Self { - Self::XML(e) - } -} - -impl From for Error { - fn from(e: ParseError) -> Self { - Self::JID(e) - } -} -- cgit