diff options
author | 2024-12-04 18:18:37 +0000 | |
---|---|---|
committer | 2024-12-04 18:18:37 +0000 | |
commit | 1b91ff690488b65b552c90bd5392b9a300c8c981 (patch) | |
tree | 9c290f69b26eba0393d7bbc05ba29c28ea74a26e /src/error.rs | |
parent | 03764f8cedb3f0a55a61be0f0a59faaa6357a83a (diff) | |
download | luz-1b91ff690488b65b552c90bd5392b9a300c8c981.tar.gz luz-1b91ff690488b65b552c90bd5392b9a300c8c981.tar.bz2 luz-1b91ff690488b65b552c90bd5392b9a300c8c981.zip |
use cargo workspace
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 78 |
1 files changed, 0 insertions, 78 deletions
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<rsasl::prelude::SASLError> for Error { - fn from(e: rsasl::prelude::SASLError) -> Self { - Self::SASL(SASLError::SASL(e)) - } -} - -impl From<peanuts::DeserializeError> for Error { - fn from(e: peanuts::DeserializeError) -> Self { - Error::Deserialization(e) - } -} - -impl From<MechanismNameError> for Error { - fn from(e: MechanismNameError) -> Self { - Self::SASL(SASLError::MechanismName(e)) - } -} - -impl From<SASLError> for Error { - fn from(e: SASLError) -> Self { - Self::SASL(e) - } -} - -impl From<Utf8Error> for Error { - fn from(_e: Utf8Error) -> Self { - Self::Utf8Decode - } -} - -impl From<peanuts::Error> for Error { - fn from(e: peanuts::Error) -> Self { - Self::XML(e) - } -} - -impl From<ParseError> for Error { - fn from(e: ParseError) -> Self { - Self::JID(e) - } -} |