mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-25 20:15:50 +00:00
4b93dbec4c
Some checks failed
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
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
* rename all directories and crates * fix all `use` * fix doc link * `dandelion/` -> `dandelion-tower/` * fix epee-encoding test * fix `json-rpc` * fix pruning * crate import fixes * fix leftover merge conflicts * fix `epee-encoding`
31 lines
1 KiB
Rust
31 lines
1 KiB
Rust
//! Database table abstraction; `trait Table`.
|
|
|
|
//---------------------------------------------------------------------------------------------------- Import
|
|
|
|
use crate::{key::Key, storable::Storable};
|
|
|
|
//---------------------------------------------------------------------------------------------------- Table
|
|
/// Database table metadata.
|
|
///
|
|
/// Purely compile time information for database tables.
|
|
///
|
|
/// ## Sealed
|
|
/// This trait is [`Sealed`](https://rust-lang.github.io/api-guidelines/future-proofing.html#sealed-traits-protect-against-downstream-implementations-c-sealed).
|
|
///
|
|
/// It is only implemented on the types inside [`tables`][crate::tables].
|
|
pub trait Table: crate::tables::private::Sealed + '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::*;
|
|
}
|