Trait brontes_database::Table
pub trait Table:
Send
+ Sync
+ Debug
+ 'static {
type Key: Key;
type Value: Value;
const TABLE: Tables;
const NAME: &'static str = _;
}
Expand description
Generic trait that a database table should follow.
The Table::Key
and Table::Value
types should implement [Encode
] and
[Decode
] when appropriate. These traits define how the data is stored and read from the
database.
It allows for the use of codecs. See [crate::models::ShardedKey
] for a custom
implementation.
Required Associated Types§
type Key: Key
type Key: Key
Key element of Table
.
Sorting should be taken into account when encoding this.
type Value: Value
type Value: Value
Value element of Table
.
Required Associated Constants§
const TABLE: Tables
const TABLE: Tables
The dynamic type of the table.
Provided Associated Constants§
Object Safety§
This trait is not object safe.