reth_db::table

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§

const NAME: &'static str

The table’s name.

const DUPSORT: bool

Whether the table is also a DUPSORT table.

Required Associated Types§

type Key: Key

Key element of Table.

Sorting should be taken into account when encoding this.

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§

Source§

impl Table for AccountChangeSets
where AccountBeforeTx: Value + 'static,

Source§

const NAME: &'static str = table_names::AccountChangeSets

Source§

const DUPSORT: bool = true

Source§

type Key = u64

Source§

type Value = AccountBeforeTx

Source§

impl Table for AccountsHistory
where BlockNumberList: Value + 'static,

Source§

const NAME: &'static str = table_names::AccountsHistory

Source§

const DUPSORT: bool = false

Source§

type Key = ShardedKey<Address>

Source§

type Value = IntegerList

Source§

impl Table for AccountsTrie
where BranchNodeCompact: Value + 'static,

Source§

const NAME: &'static str = table_names::AccountsTrie

Source§

const DUPSORT: bool = false

Source§

type Key = StoredNibbles

Source§

type Value = BranchNodeCompact

Source§

impl Table for BlockBodyIndices
where StoredBlockBodyIndices: Value + 'static,

Source§

const NAME: &'static str = table_names::BlockBodyIndices

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = StoredBlockBodyIndices

Source§

impl Table for BlockWithdrawals
where StoredBlockWithdrawals: Value + 'static,

Source§

const NAME: &'static str = table_names::BlockWithdrawals

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = StoredBlockWithdrawals

Source§

impl Table for Bytecodes
where Bytecode: Value + 'static,

Source§

const NAME: &'static str = table_names::Bytecodes

Source§

const DUPSORT: bool = false

Source§

type Key = FixedBytes<32>

Source§

type Value = Bytecode

Source§

impl Table for CanonicalHeaders
where HeaderHash: Value + 'static,

Source§

const NAME: &'static str = table_names::CanonicalHeaders

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = FixedBytes<32>

Source§

impl Table for ChainState
where BlockNumber: Value + 'static,

Source§

const NAME: &'static str = table_names::ChainState

Source§

const DUPSORT: bool = false

Source§

type Key = ChainStateKey

Source§

type Value = u64

Source§

impl Table for HashedAccounts
where Account: Value + 'static,

Source§

const NAME: &'static str = table_names::HashedAccounts

Source§

const DUPSORT: bool = false

Source§

type Key = FixedBytes<32>

Source§

type Value = Account

Source§

impl Table for HashedStorages
where StorageEntry: Value + 'static,

Source§

const NAME: &'static str = table_names::HashedStorages

Source§

const DUPSORT: bool = true

Source§

type Key = FixedBytes<32>

Source§

type Value = StorageEntry

Source§

impl Table for HeaderNumbers
where BlockNumber: Value + 'static,

Source§

const NAME: &'static str = table_names::HeaderNumbers

Source§

const DUPSORT: bool = false

Source§

type Key = FixedBytes<32>

Source§

type Value = u64

Source§

impl Table for HeaderTerminalDifficulties
where CompactU256: Value + 'static,

Source§

const NAME: &'static str = table_names::HeaderTerminalDifficulties

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = CompactU256

Source§

impl Table for PlainAccountState
where Account: Value + 'static,

Source§

const NAME: &'static str = table_names::PlainAccountState

Source§

const DUPSORT: bool = false

Source§

type Key = Address

Source§

type Value = Account

Source§

impl Table for PlainStorageState
where StorageEntry: Value + 'static,

Source§

const NAME: &'static str = table_names::PlainStorageState

Source§

const DUPSORT: bool = true

Source§

type Key = Address

Source§

type Value = StorageEntry

Source§

impl Table for PruneCheckpoints
where PruneCheckpoint: Value + 'static,

Source§

const NAME: &'static str = table_names::PruneCheckpoints

Source§

const DUPSORT: bool = false

Source§

type Key = PruneSegment

Source§

type Value = PruneCheckpoint

Source§

impl Table for StageCheckpointProgresses
where Vec<u8>: Value + 'static,

Source§

const NAME: &'static str = table_names::StageCheckpointProgresses

Source§

const DUPSORT: bool = false

Source§

type Key = String

Source§

type Value = Vec<u8>

Source§

impl Table for StageCheckpoints
where StageCheckpoint: Value + 'static,

Source§

const NAME: &'static str = table_names::StageCheckpoints

Source§

const DUPSORT: bool = false

Source§

type Key = String

Source§

type Value = StageCheckpoint

Source§

impl Table for StorageChangeSets
where StorageEntry: Value + 'static,

Source§

const NAME: &'static str = table_names::StorageChangeSets

Source§

const DUPSORT: bool = true

Source§

type Key = BlockNumberAddress

Source§

type Value = StorageEntry

Source§

impl Table for StoragesHistory
where BlockNumberList: Value + 'static,

Source§

const NAME: &'static str = table_names::StoragesHistory

Source§

const DUPSORT: bool = false

Source§

type Key = StorageShardedKey

Source§

type Value = IntegerList

Source§

impl Table for StoragesTrie
where StorageTrieEntry: Value + 'static,

Source§

const NAME: &'static str = table_names::StoragesTrie

Source§

const DUPSORT: bool = true

Source§

type Key = FixedBytes<32>

Source§

type Value = StorageTrieEntry

Source§

impl Table for TransactionBlocks
where BlockNumber: Value + 'static,

Source§

const NAME: &'static str = table_names::TransactionBlocks

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = u64

Source§

impl Table for TransactionHashNumbers
where TxNumber: Value + 'static,

Source§

const NAME: &'static str = table_names::TransactionHashNumbers

Source§

const DUPSORT: bool = false

Source§

type Key = FixedBytes<32>

Source§

type Value = u64

Source§

impl Table for TransactionSenders
where Address: Value + 'static,

Source§

const NAME: &'static str = table_names::TransactionSenders

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = Address

Source§

impl Table for VersionHistory
where ClientVersion: Value + 'static,

Source§

const NAME: &'static str = table_names::VersionHistory

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = ClientVersion

Source§

impl<H> Table for BlockOmmers<H>
where StoredBlockOmmers<H>: Value + 'static, H: Send + Sync,

Source§

const NAME: &'static str = table_names::BlockOmmers

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = StoredBlockOmmers<H>

Source§

impl<H> Table for Headers<H>
where H: Value + 'static + Send + Sync,

Source§

const NAME: &'static str = table_names::Headers

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = H

Source§

impl<R> Table for Receipts<R>
where R: Value + 'static + Send + Sync,

Source§

const NAME: &'static str = table_names::Receipts

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = R

Source§

impl<T> Table for Transactions<T>
where T: Value + 'static + Send + Sync,

Source§

const NAME: &'static str = table_names::Transactions

Source§

const DUPSORT: bool = false

Source§

type Key = u64

Source§

type Value = T

Source§

impl<T: DupSort> Table for RawDupSort<T>

Source§

const NAME: &'static str = T::NAME

Source§

const DUPSORT: bool = true

Source§

type Key = RawKey<<T as Table>::Key>

Source§

type Value = RawValue<<T as Table>::Value>

Source§

impl<T: Table> Table for RawTable<T>

Source§

const NAME: &'static str = T::NAME

Source§

const DUPSORT: bool = false

Source§

type Key = RawKey<<T as Table>::Key>

Source§

type Value = RawValue<<T as Table>::Value>