reth_db_api::table

Trait Table

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

Source

const NAME: &'static str

The table’s name.

Source

const DUPSORT: bool

Whether the table is also a DUPSORT table.

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.

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.

Implementors§