#[doc(hidden)]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(doc)]
use super::enums::OperationState;
use alloc::{boxed::Box, string::String};
use thiserror::Error;
pub type Result<T> = core::result::Result<T, Box<dyn core::error::Error + Send + Sync + 'static>>;
#[derive(Error, Debug)]
pub enum Error {
#[error("decoding failed: reason {source}")]
Decoding {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("sending a reply failed: reason {source}")]
Reply {
source: Box<dyn core::error::Error + Send + Sync>,
},
#[error("query was empty")]
EmptyQuery,
#[error("no implementation available")]
NotImplemented,
#[error("the operation state {state} is unknown")]
UnknownOperationState {
state: String,
},
}
#[cfg(test)]
mod tests {
use super::*;
const fn is_normal<T: Sized + Send + Sync>() {}
#[test]
const fn normal_types() {
is_normal::<Error>();
}
}