Trait Table
pub trait Table:
Send
+ Sync
+ Debug
+ 'static {
type Key: Key;
type Value: Value;
const NAME: &'static str;
const DUPSORT: bool;
}
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 Constants§
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.