#[macro_export] macro_rules! match_each_decimal_value {
($decimal_value:expr, | $ident:ident | $body:block) => {
match $decimal_value {
DecimalValue::I8($ident) => $body,
DecimalValue::I16($ident) => $body,
DecimalValue::I32($ident) => $body,
DecimalValue::I64($ident) => $body,
DecimalValue::I128($ident) => $body,
DecimalValue::I256($ident) => $body,
}
};
}
#[macro_export] macro_rules! match_each_decimal_value_type {
($self:expr, | $enc:ident | $body:block) => {{
use $crate::DecimalType;
match $self {
DecimalType::I8 => {
type $enc = i8;
$body
}
DecimalType::I16 => {
type $enc = i16;
$body
}
DecimalType::I32 => {
type $enc = i32;
$body
}
DecimalType::I64 => {
type $enc = i64;
$body
}
DecimalType::I128 => {
type $enc = i128;
$body
}
DecimalType::I256 => {
type $enc = $crate::i256;
$body
}
}
}};
}