#![allow(unused_macros)]
macro_rules! gen_match {
($ret:expr, $($($mtch:pat)+ $(if $exp:expr)*, $expect:expr),*) => {
match $ret {
$($(Ok($mtch))|* $(if $exp:expr)* => Ok($expect),)*
Ok($crate::Element::RespCode(rc)) => Err($crate::error::SkyhashError::Code(rc).into()),
Ok(_) => Err($crate::error::SkyhashError::UnexpectedDataType.into()),
Err(e) => Err(e),
}
};
}
macro_rules! match_estr {
(
$ret:expr,
$($mtch:pat => $expect:expr),*
) => {
match $ret.as_str() {
$($mtch => $expect,)*
_ => return Err($crate::error::SkyhashError::UnexpectedResponse.into())
}
};
}
macro_rules! cfg_sync_ssl_any {
($($body:item)*) => {
$(
#[cfg(all(feature = "sync", any(feature = "ssl", feature = "sslv")))]
#[cfg_attr(docsrs, doc(cfg(all(feature="sync", any(feature = "ssl", feature = "sslv")))))]
$body
)*
};
}
macro_rules! cfg_ssl_any {
($($body:item)*) => {
$(
#[cfg(any(feature = "ssl", feature = "sslv", feature="aio-ssl", feature="aio-sslv"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "ssl", feature = "sslv", feature="aio-ssl", feature="aio-sslv"))))]
$body
)*
};
}
macro_rules! cfg_async_ssl_any {
($($body:item)*) => {
$(
#[cfg(all(feature = "aio", any(feature = "aio-ssl", feature = "aio-sslv")))]
#[cfg_attr(docsrs, doc(cfg(all(feature="aio", any(feature = "aio-ssl", feature = "aio-sslv")))))]
$body
)*
};
}
macro_rules! cfg_sync {
($($body:item)*) => {
$(
#[cfg(feature = "sync")]
#[cfg_attr(docsrs, doc(cfg(feature = "sync")))]
$body
)*
};
}
macro_rules! cfg_async {
($($body:item)*) => {
$(
#[cfg(feature = "aio")]
#[cfg_attr(docsrs, doc(cfg(feature = "aio")))]
$body
)*
};
}
macro_rules! cfg_dbg {
($($body:item)*) => {
$(
#[cfg(feature = "dbg")]
#[cfg_attr(docsrs, doc(cfg(feature = "dbg")))]
$body
)*
};
}