Trait Table

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

    const NAME: &'static str;
    const DUPSORT: bool;
}
Available on crate feature provider only.
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§

§

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

§

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

§

const DUPSORT: bool = true

§

type Key = u64

§

type Value = AccountBeforeTx

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = ShardedKey<Address>

§

type Value = IntegerList

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = StoredNibbles

§

type Value = BranchNodeCompact

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = StoredBlockBodyIndices

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = StoredBlockWithdrawals

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = FixedBytes<32>

§

type Value = Bytecode

§

impl Table for CanonicalHeaders
where FixedBytes<32>: Value + 'static,

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = FixedBytes<32>

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = ChainStateKey

§

type Value = u64

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = FixedBytes<32>

§

type Value = Account

§

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

§

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

§

const DUPSORT: bool = true

§

type Key = FixedBytes<32>

§

type Value = StorageEntry

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = FixedBytes<32>

§

type Value = u64

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = CompactU256

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = Address

§

type Value = Account

§

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

§

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

§

const DUPSORT: bool = true

§

type Key = Address

§

type Value = StorageEntry

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = PruneSegment

§

type Value = PruneCheckpoint

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = String

§

type Value = Vec<u8>

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = String

§

type Value = StageCheckpoint

§

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

§

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

§

const DUPSORT: bool = true

§

type Key = BlockNumberAddress

§

type Value = StorageEntry

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = StorageShardedKey

§

type Value = IntegerList

§

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

§

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

§

const DUPSORT: bool = true

§

type Key = FixedBytes<32>

§

type Value = StorageTrieEntry

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = u64

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = FixedBytes<32>

§

type Value = u64

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = Address

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = ClientVersion

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = StoredBlockOmmers<H>

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = H

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = R

§

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

§

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

§

const DUPSORT: bool = true

§

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

§

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

§

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

§

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

§

const DUPSORT: bool = false

§

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

§

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

§

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

§

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

§

const DUPSORT: bool = false

§

type Key = u64

§

type Value = T