reth_db_api::table

Trait Table

source
pub trait Table:
    Send
    + Sync
    + Debug
    + 'static {
    type Key: Key;
    type Value: Value;

    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 Constants§

source

const NAME: &'static str

The table’s name.

Required Associated Types§

source

type Key: Key

Key element of Table.

Sorting should be taken into account when encoding this.

source

type Value: Value

Value element of Table.

Object Safety§

This trait is not object safe.

Implementors§