Macro impl_table_access

macro_rules! impl_table_access {
    ($raw:ty, $id:expr, $variant:ident) => { ... };
}
Expand description

Generate TableAccess trait implementations for metadata tables.

This macro creates type-safe implementations of the TableAccess trait, mapping each row type to its corresponding TableData variant and TableId. This eliminates the need for unsafe code while maintaining performance.

§Arguments

  • $raw - The raw row type (e.g., TypeDefRaw)
  • $id - The TableId variant (e.g., TableId::TypeDef)
  • $variant - The TableData variant (e.g., TypeDef)

§Example

impl_table_access!(TypeDefRaw, TableId::TypeDef, TypeDef);
impl_table_access!(MethodDefRaw, TableId::MethodDef, MethodDef);