1#[macro_export]
19macro_rules! for_all_primitive_types {
20 ($macro:tt $(, $x:tt)*) => {
21 $macro! {
22 [$($x),*],
23 { i8 },
24 { i16 },
25 { i32 },
26 { i64 },
27 { u8 },
28 { u16 },
29 { u32 },
30 { u64 },
31 { f32 },
32 { f64 }
33 }
34 };
35}
36
37#[macro_export]
40macro_rules! with_match_primitive_type_id {
41 ($key_type:expr, | $_:tt $T:ident | $body:tt, $nbody:tt) => {{
42 macro_rules! __with_ty__ {
43 ( $_ $T:ident ) => {
44 $body
45 };
46 }
47
48 use $crate::type_id::LogicalTypeId;
49 use $crate::types::{
50 Float32Type, Float64Type, Int16Type, Int32Type, Int64Type, Int8Type, UInt16Type,
51 UInt32Type, UInt64Type, UInt8Type,
52 };
53 match $key_type {
54 LogicalTypeId::Int8 => __with_ty__! { Int8Type },
55 LogicalTypeId::Int16 => __with_ty__! { Int16Type },
56 LogicalTypeId::Int32 => __with_ty__! { Int32Type },
57 LogicalTypeId::Int64 => __with_ty__! { Int64Type },
58 LogicalTypeId::UInt8 => __with_ty__! { UInt8Type },
59 LogicalTypeId::UInt16 => __with_ty__! { UInt16Type },
60 LogicalTypeId::UInt32 => __with_ty__! { UInt32Type },
61 LogicalTypeId::UInt64 => __with_ty__! { UInt64Type },
62 LogicalTypeId::Float32 => __with_ty__! { Float32Type },
63 LogicalTypeId::Float64 => __with_ty__! { Float64Type },
64
65 _ => $nbody,
66 }
67 }};
68}