pub mod agent;
pub mod application;
pub mod element;
pub mod management;
pub mod network;
pub mod node;
pub mod provisioner;
use std::time::Duration;
use strum::IntoStaticStr;
use crate::ERR_PREFIX;
pub(crate) const SERVICE_NAME: &str = "org.bluez.mesh";
pub(crate) const PATH: &str = "/org/bluez/mesh";
pub(crate) const TIMEOUT: Duration = Duration::from_secs(120);
#[derive(Clone, Copy, Debug, displaydoc::Display, Eq, PartialEq, Ord, PartialOrd, Hash, IntoStaticStr)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub enum ReqError {
Failed,
InProgress,
InvalidOffset,
InvalidValueLength,
NotPermitted,
NotAuthorized,
NotSupported,
}
impl std::error::Error for ReqError {}
impl Default for ReqError {
fn default() -> Self {
Self::Failed
}
}
impl From<ReqError> for dbus::MethodErr {
fn from(err: ReqError) -> Self {
let name: &'static str = err.into();
Self::from((ERR_PREFIX.to_string() + name, &err.to_string()))
}
}
pub type ReqResult<T> = std::result::Result<T, ReqError>;