mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-23 12:09:52 +00:00
0a390a362a
Some checks are pending
CI / fmt (push) Waiting to run
CI / typo (push) Waiting to run
CI / ci (macos-latest, stable, bash) (push) Waiting to run
CI / ci (ubuntu-latest, stable, bash) (push) Waiting to run
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Waiting to run
Doc / build (push) Waiting to run
Doc / deploy (push) Blocked by required conditions
* database: doc fixes * blockchain: doc fixes * database: fix doc test * database: readme fixes * blockchain: ops fix * blockchain: readme fix
28 lines
831 B
Rust
28 lines
831 B
Rust
//! Database table abstraction; `trait Table`.
|
|
|
|
//---------------------------------------------------------------------------------------------------- Import
|
|
|
|
use crate::{key::Key, storable::Storable};
|
|
|
|
//---------------------------------------------------------------------------------------------------- Table
|
|
/// Database table metadata.
|
|
///
|
|
/// Purely compile time information for database tables.
|
|
///
|
|
/// See [`crate::define_tables`] for bulk table generation.
|
|
pub trait Table: 'static {
|
|
/// Name of the database table.
|
|
const NAME: &'static str;
|
|
|
|
/// Primary key type.
|
|
type Key: Key + 'static;
|
|
|
|
/// Value type.
|
|
type Value: Storable + 'static;
|
|
}
|
|
|
|
//---------------------------------------------------------------------------------------------------- Tests
|
|
#[cfg(test)]
|
|
mod test {
|
|
// use super::*;
|
|
}
|