cuprate_txpool::tables

Trait Tables

Source
pub trait Tables {
    // Required methods
    fn transaction_blobs(&self) -> &impl DatabaseRo<TransactionBlobs>;
    fn transaction_infos(&self) -> &impl DatabaseRo<TransactionInfos>;
    fn cached_verification_state(
        &self,
    ) -> &impl DatabaseRo<CachedVerificationState>;
    fn spent_key_images(&self) -> &impl DatabaseRo<SpentKeyImages>;
    fn known_blob_hashes(&self) -> &impl DatabaseRo<KnownBlobHashes>;
    fn all_tables_empty(&self) -> Result<bool, RuntimeError>;
}
Expand description

Object containing all opened Tables in read-only mode.

This is an encapsulated object that contains all available Table’s in read-only mode.

It is a Sealed trait and is only implemented on a (tuple, containing, all, table, types, ...).

This is used to return a single object from functions like OpenTables::open_tables rather than the tuple containing the tables itself.

To replace tuple.0 style indexing, field_accessor_functions() are provided on this trait, which essentially map the object to fields containing the particular database table, for example:

let tables = open_tables();

// The accessor function `block_infos()` returns the field
// containing an open database table for `BlockInfos`.
let _ = tables.block_infos();

See also:

Required Methods§

Source

fn transaction_blobs(&self) -> &impl DatabaseRo<TransactionBlobs>

Access an opened TransactionBlobs database.

Source

fn transaction_infos(&self) -> &impl DatabaseRo<TransactionInfos>

Access an opened TransactionInfos database.

Source

fn cached_verification_state(&self) -> &impl DatabaseRo<CachedVerificationState>

Access an opened CachedVerificationState database.

Source

fn spent_key_images(&self) -> &impl DatabaseRo<SpentKeyImages>

Access an opened SpentKeyImages database.

Source

fn known_blob_hashes(&self) -> &impl DatabaseRo<KnownBlobHashes>

Access an opened KnownBlobHashes database.

Source

fn all_tables_empty(&self) -> Result<bool, RuntimeError>

This returns true if all tables are empty.

§Errors

This returns errors on regular database errors.

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.

Implementations on Foreign Types§

Source§

impl<TRANSACTIONBLOBS, TRANSACTIONINFOS, CACHEDVERIFICATIONSTATE, SPENTKEYIMAGES, KNOWNBLOBHASHES> Tables for (TRANSACTIONBLOBS, TRANSACTIONINFOS, CACHEDVERIFICATIONSTATE, SPENTKEYIMAGES, KNOWNBLOBHASHES)
where TRANSACTIONBLOBS: DatabaseRo<TransactionBlobs>, TRANSACTIONINFOS: DatabaseRo<TransactionInfos>, CACHEDVERIFICATIONSTATE: DatabaseRo<CachedVerificationState>, SPENTKEYIMAGES: DatabaseRo<SpentKeyImages>, KNOWNBLOBHASHES: DatabaseRo<KnownBlobHashes>,

Implementors§