reth_db/static_file/
mask.rsuse reth_db_api::table::Decompress;
pub trait ColumnSelectorOne {
type FIRST: Decompress;
const MASK: usize;
}
pub trait ColumnSelectorTwo {
type FIRST: Decompress;
type SECOND: Decompress;
const MASK: usize;
}
pub trait ColumnSelectorThree {
type FIRST: Decompress;
type SECOND: Decompress;
type THIRD: Decompress;
const MASK: usize;
}
#[macro_export]
macro_rules! add_static_file_mask {
($(#[$attr:meta])* $mask_struct:ident $(<$generic:ident>)?, $type1:ty, $mask:expr) => {
$(#[$attr])*
#[derive(Debug)]
pub struct $mask_struct$(<$generic>)?$((std::marker::PhantomData<$generic>))?;
impl$(<$generic>)? ColumnSelectorOne for $mask_struct$(<$generic>)?
where
$type1: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
{
type FIRST = $type1;
const MASK: usize = $mask;
}
};
($(#[$attr:meta])* $mask_struct:ident $(<$generic:ident>)?, $type1:ty, $type2:ty, $mask:expr) => {
$(#[$attr])*
#[derive(Debug)]
pub struct $mask_struct$(<$generic>)?$((std::marker::PhantomData<$generic>))?;
impl$(<$generic>)? ColumnSelectorTwo for $mask_struct$(<$generic>)?
where
$type1: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
$type2: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
{
type FIRST = $type1;
type SECOND = $type2;
const MASK: usize = $mask;
}
};
($(#[$attr:meta])* $mask_struct:ident $(<$generic:ident>)?, $type1:ty, $type2:ty, $type3:ty, $mask:expr) => {
$(#[$attr])*
#[derive(Debug)]
pub struct $mask_struct$(<$generic>)?$((std::marker::PhantomData<$generic>))?;
impl$(<$generic>)? ColumnSelectorThree for $mask_struct$(<$generic>)?
where
$type1: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
$type2: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
$type3: Send + Sync + std::fmt::Debug + reth_db_api::table::Decompress,
{
type FIRST = $type1;
type SECOND = $type2;
type THIRD = $type3;
const MASK: usize = $mask;
}
};
}