#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "std")]
use std::prelude::rust_2021::*;
pub type Result<T> = core::result::Result<T, Box<dyn core::error::Error + Send + Sync + 'static>>;
#[non_exhaustive]
#[derive(thiserror::Error, Debug)]
#[allow(clippy::module_name_repetitions)]
pub enum DimasError {
#[error("should not happen")]
ShouldNotHappen,
#[error("Publisher 'put' failed")]
Put,
#[error("Publisher 'delete' failed")]
Delete,
#[error("Query 'get' failed")]
Get,
#[error("message encoding failed")]
Encoding,
#[error("converting value into 'Vec<u8>' failed")]
ConvertingValue,
#[error("message decoding failed")]
Decoding,
#[error("no message received")]
NoMessage,
#[error("read of properties failed")]
ReadProperties,
#[error("write of properties failed")]
WriteProperties,
#[error("could not execute callback")]
ExecuteCallback,
#[error("invalid OperationState {0}")]
OperationState(String),
#[error("could not find file: {0}")]
FileNotFound(String),
#[error("modifying context for {0} failed")]
ModifyContext(String),
#[error("setting the 'OperationState' failed")]
ManageState,
#[error("reading context for {0} failed")]
ReadContext(String),
#[error("creation of zenoh session failed with {0}")]
CreateSession(#[source] Box<dyn core::error::Error + Send + Sync + 'static>),
#[error("activation of zenoh liveliness failed with {0}")]
ActivateLiveliness(#[source] Box<dyn core::error::Error + Send + Sync + 'static>),
#[error("declaration of zenoh publisher failed with {0}")]
DeclarePublisher(#[source] Box<dyn core::error::Error + Send + Sync + 'static>),
#[error(transparent)]
StdError(#[from] Box<dyn core::error::Error + Send + Sync + 'static>),
} #[cfg(test)]
mod tests {
use super::*;
const fn is_normal<T: Sized + Send + Sync>() {}
#[test]
const fn normal_types() {
is_normal::<DimasError>();
}
}