#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
Api(#[from] windows::core::Error),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("UiThreadClosed")]
UiThreadClosed,
}
pub type Result<T> = ::core::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum TryRecvError {
#[error("Empty")]
Empty,
#[error("Disconnected")]
Disconnected,
}
pub type TryRecvResult<T> = ::core::result::Result<T, TryRecvError>;
macro_rules! error {
($($arg:tt)*) => {
#[cfg(feature = "tracing")]
tracing::error!($($arg)*);
#[cfg(not(feature = "tracing"))]
{ format_args!($($arg)*); }
};
}
macro_rules! warning {
($($arg:tt)+) => {
#[cfg(feature = "tracing")]
tracing::warn!($($arg)*);
#[cfg(not(feature = "tracing"))]
{ format_args!($($arg)*); }
};
}
macro_rules! info {
($($arg:tt)*) => {
#[cfg(feature = "tracing")]
tracing::info!($($arg)*);
#[cfg(not(feature = "tracing"))]
{ format_args!($($arg)*); }
};
}
pub(crate) use error;
pub(crate) use info;
pub(crate) use warning;