interstice-sdk-core 0.5.0

Core SDK utilities used by Interstice modules and macros
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Row struct metadata shared by `#[table]` and schema registration.

use interstice_abi::{ModuleSelection, NodeSelection, ReducerTableRef};

/// Implemented by every `#[table]` row type. Maps the Rust struct to the module table name string.
pub trait TableRow {
    const TABLE_NAME: &'static str;

    fn table_ref() -> ReducerTableRef {
        ReducerTableRef {
            node_selection: NodeSelection::Current,
            module_selection: ModuleSelection::Current,
            table_name: Self::TABLE_NAME.to_string(),
        }
    }
}