Trait cuprate_blockchain::tables::Tables

source ·
pub trait Tables: Sealed {
Show 16 methods // Required methods fn block_infos(&self) -> &impl DatabaseRo<BlockInfos>; fn block_blobs(&self) -> &impl DatabaseRo<BlockBlobs>; fn block_heights(&self) -> &impl DatabaseRo<BlockHeights>; fn key_images(&self) -> &impl DatabaseRo<KeyImages>; fn num_outputs(&self) -> &impl DatabaseRo<NumOutputs>; fn pruned_tx_blobs(&self) -> &impl DatabaseRo<PrunedTxBlobs>; fn prunable_hashes(&self) -> &impl DatabaseRo<PrunableHashes>; fn outputs(&self) -> &impl DatabaseRo<Outputs>; fn prunable_tx_blobs(&self) -> &impl DatabaseRo<PrunableTxBlobs>; fn rct_outputs(&self) -> &impl DatabaseRo<RctOutputs>; fn tx_blobs(&self) -> &impl DatabaseRo<TxBlobs>; fn tx_ids(&self) -> &impl DatabaseRo<TxIds>; fn tx_heights(&self) -> &impl DatabaseRo<TxHeights>; fn tx_outputs(&self) -> &impl DatabaseRo<TxOutputs>; fn tx_unlock_time(&self) -> &impl DatabaseRo<TxUnlockTime>; 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 block_infos(&self) -> &impl DatabaseRo<BlockInfos>

Access an opened BlockInfos database.

source

fn block_blobs(&self) -> &impl DatabaseRo<BlockBlobs>

Access an opened BlockBlobs database.

source

fn block_heights(&self) -> &impl DatabaseRo<BlockHeights>

Access an opened BlockHeights database.

source

fn key_images(&self) -> &impl DatabaseRo<KeyImages>

Access an opened KeyImages database.

source

fn num_outputs(&self) -> &impl DatabaseRo<NumOutputs>

Access an opened NumOutputs database.

source

fn pruned_tx_blobs(&self) -> &impl DatabaseRo<PrunedTxBlobs>

Access an opened PrunedTxBlobs database.

source

fn prunable_hashes(&self) -> &impl DatabaseRo<PrunableHashes>

Access an opened PrunableHashes database.

source

fn outputs(&self) -> &impl DatabaseRo<Outputs>

Access an opened Outputs database.

source

fn prunable_tx_blobs(&self) -> &impl DatabaseRo<PrunableTxBlobs>

Access an opened PrunableTxBlobs database.

source

fn rct_outputs(&self) -> &impl DatabaseRo<RctOutputs>

Access an opened RctOutputs database.

source

fn tx_blobs(&self) -> &impl DatabaseRo<TxBlobs>

Access an opened TxBlobs database.

source

fn tx_ids(&self) -> &impl DatabaseRo<TxIds>

Access an opened TxIds database.

source

fn tx_heights(&self) -> &impl DatabaseRo<TxHeights>

Access an opened TxHeights database.

source

fn tx_outputs(&self) -> &impl DatabaseRo<TxOutputs>

Access an opened TxOutputs database.

source

fn tx_unlock_time(&self) -> &impl DatabaseRo<TxUnlockTime>

Access an opened TxUnlockTime 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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<BLOCKINFOS, BLOCKBLOBS, BLOCKHEIGHTS, KEYIMAGES, NUMOUTPUTS, PRUNEDTXBLOBS, PRUNABLEHASHES, OUTPUTS, PRUNABLETXBLOBS, RCTOUTPUTS, TXBLOBS, TXIDS, TXHEIGHTS, TXOUTPUTS, TXUNLOCKTIME> Tables for (BLOCKINFOS, BLOCKBLOBS, BLOCKHEIGHTS, KEYIMAGES, NUMOUTPUTS, PRUNEDTXBLOBS, PRUNABLEHASHES, OUTPUTS, PRUNABLETXBLOBS, RCTOUTPUTS, TXBLOBS, TXIDS, TXHEIGHTS, TXOUTPUTS, TXUNLOCKTIME)
where BLOCKINFOS: DatabaseRo<BlockInfos>, BLOCKBLOBS: DatabaseRo<BlockBlobs>, BLOCKHEIGHTS: DatabaseRo<BlockHeights>, KEYIMAGES: DatabaseRo<KeyImages>, NUMOUTPUTS: DatabaseRo<NumOutputs>, PRUNEDTXBLOBS: DatabaseRo<PrunedTxBlobs>, PRUNABLEHASHES: DatabaseRo<PrunableHashes>, OUTPUTS: DatabaseRo<Outputs>, PRUNABLETXBLOBS: DatabaseRo<PrunableTxBlobs>, RCTOUTPUTS: DatabaseRo<RctOutputs>, TXBLOBS: DatabaseRo<TxBlobs>, TXIDS: DatabaseRo<TxIds>, TXHEIGHTS: DatabaseRo<TxHeights>, TXOUTPUTS: DatabaseRo<TxOutputs>, TXUNLOCKTIME: DatabaseRo<TxUnlockTime>,

Implementors§