Skip to main content

interstice_sdk_core/
table_row.rs

1//! Row struct metadata shared by `#[table]` and schema registration.
2
3use interstice_abi::{ModuleSelection, NodeSelection, ReducerTableRef};
4
5/// Implemented by every `#[table]` row type. Maps the Rust struct to the module table name string.
6pub trait TableRow {
7    const TABLE_NAME: &'static str;
8
9    fn table_ref() -> ReducerTableRef {
10        ReducerTableRef {
11            node_selection: NodeSelection::Current,
12            module_selection: ModuleSelection::Current,
13            table_name: Self::TABLE_NAME.to_string(),
14        }
15    }
16}