#[doc(hidden)]
#[macro_export]
macro_rules! _basic_types {
(@expand bool $($tail:tt)+) => {
$crate::metadata::BasicTypes::BOOL.or($crate::_basic_types!($($tail)+))
};
(@expand int $($tail:tt)+) => {
$crate::metadata::BasicTypes::INTEGER.or($crate::_basic_types!(@expand $($tail)+))
};
(@expand float $($tail:tt)+) => {
$crate::metadata::BasicTypes::FLOAT.or($crate::_basic_types!(@expand $($tail)+))
};
(@expand str $($tail:tt)+) => {
$crate::metadata::BasicTypes::STRING.or($crate::_basic_types!(@expand $($tail)+))
};
(@expand array $($tail:tt)+) => {
$crate::metadata::BasicTypes::ARRAY.or($crate::_basic_types!(@expand $($tail)+))
};
(@expand object $($tail:tt)+) => {
$crate::metadata::BasicTypes::OBJECT.or($crate::_basic_types!(@expand $($tail)+))
};
(@expand bool) => {
$crate::metadata::BasicTypes::BOOL
};
(@expand int) => {
$crate::metadata::BasicTypes::INTEGER
};
(@expand float) => {
$crate::metadata::BasicTypes::FLOAT
};
(@expand str) => {
$crate::metadata::BasicTypes::STRING
};
(@expand array) => {
$crate::metadata::BasicTypes::ARRAY
};
(@expand object) => {
$crate::metadata::BasicTypes::OBJECT
};
($($expecting:tt)+) => {
$crate::metadata::BasicTypes::raw($crate::_basic_types!(@expand $($expecting)+))
};
}
#[macro_export]
#[allow(non_snake_case)]
macro_rules! Serde {
(*) => {
$crate::de::Serde::<{ $crate::metadata::BasicTypes::ANY.raw() }>
};
($($expecting:tt),+ $(,)?) => {
$crate::de::Serde::<{ $crate::_basic_types!($($expecting)+) }>
};
}
pub use Serde;