Skip to main content

declare_table

Macro declare_table 

Source
macro_rules! declare_table {
    ($typ:ident, $name:expr, $key:ty, $value:ty) => { ... };
    ($typ:ident, $name:expr, $key:ty => dup($value:ty)) => { ... };
    ($typ:ident, $name:expr, $key:ty => $value:ty) => { ... };
    ($typ:ident, $name:expr, $key:ty => $subkey:ty => $value:ty) => { ... };
}
Expand description

Examples:

  • declare_table!(Test, "test", u32 => u32) will create a regular table mapping u32 to u32.
  • declare_table!(Test, "test", u32 => u32 => u32) will create a dup table mapping u32 to a subkey of u32 to a value of u32.
  • declare_table!(Test, "test", u32 => dup(Foo)) will create a dup table mapping u32 to Foo.