cuprate_database/table.rs
1//! Database table abstraction; `trait Table`.
2
3//---------------------------------------------------------------------------------------------------- Import
4use crate::{key::Key, storable::Storable};
5
6//---------------------------------------------------------------------------------------------------- Table
7/// Database table metadata.
8///
9/// Purely compile time information for database tables.
10///
11/// See [`crate::define_tables`] for bulk table generation.
12pub trait Table: 'static {
13 /// Name of the database table.
14 const NAME: &'static str;
15
16 /// Primary key type.
17 type Key: Key + 'static;
18
19 /// Value type.
20 type Value: Storable + 'static;
21}
22
23//---------------------------------------------------------------------------------------------------- Tests
24#[cfg(test)]
25mod test {
26 // use super::*;
27}