summaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-07-11 21:28:42 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-07-11 21:28:42 +0100
commitf43911ccbae3856b35b0d3e8ec6ac6450e295da6 (patch)
tree492b195cc06b08e546c059c16a748f369995eab1 /src/error.rs
parent143a0365d0822e6786cdac3530a725bbf450f38f (diff)
downloadluz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.gz
luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.bz2
luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.zip
remove serde functions
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 20ebc3e..37be7fa 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,7 +1,13 @@
use std::str::Utf8Error;
+use quick_xml::events::attributes::AttrError;
use rsasl::mechname::MechanismNameError;
+use crate::{
+ element::{self, ElementError},
+ jid::ParseError,
+};
+
#[derive(Debug)]
pub enum JabberError {
Connection,
@@ -9,8 +15,13 @@ pub enum JabberError {
StartTlsUnavailable,
TlsNegotiation,
Utf8Decode,
+ NoFeatures,
+ UnknownNamespace,
+ ParseError,
XML(quick_xml::Error),
SASL(SASLError),
+ Element(ElementError<'static>),
+ JID(ParseError),
}
#[derive(Debug)]
@@ -32,7 +43,7 @@ impl From<MechanismNameError> for JabberError {
}
impl From<Utf8Error> for JabberError {
- fn from(e: Utf8Error) -> Self {
+ fn from(_e: Utf8Error) -> Self {
Self::Utf8Decode
}
}
@@ -42,3 +53,21 @@ impl From<quick_xml::Error> for JabberError {
Self::XML(e)
}
}
+
+impl From<element::ElementError<'static>> for JabberError {
+ fn from(e: element::ElementError<'static>) -> Self {
+ Self::Element(e)
+ }
+}
+
+impl From<AttrError> for JabberError {
+ fn from(e: AttrError) -> Self {
+ Self::XML(e.into())
+ }
+}
+
+impl From<ParseError> for JabberError {
+ fn from(e: ParseError) -> Self {
+ Self::JID(e)
+ }
+}