Skip to main content

TransactionKeyValueStoreTrait

Trait TransactionKeyValueStoreTrait 

Source
pub trait TransactionKeyValueStoreTrait {
    // Required methods
    fn multi_get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        transaction_keys: &'life1 [TransactionDigest],
        effects_keys: &'life2 [TransactionDigest],
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Option<Envelope<SenderSignedTransaction, EmptySignInfo>>>, Vec<Option<TransactionEffects>>), IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn multi_get_checkpoints<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        checkpoint_summaries: &'life1 [u64],
        checkpoint_contents: &'life2 [u64],
        checkpoint_summaries_by_digest: &'life3 [CheckpointDigest],
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Option<Envelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>>>, Vec<Option<CheckpointContents>>, Vec<Option<Envelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>>>), IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn get_transaction_perpetual_checkpoint<'life0, 'async_trait>(
        &'life0 self,
        digest: TransactionDigest,
    ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_object<'life0, 'async_trait>(
        &'life0 self,
        object_id: ObjectId,
        version: Version,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Object>, IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn multi_get_objects<'life0, 'life1, 'async_trait>(
        &'life0 self,
        object_keys: &'life1 [ObjectKey],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Object>>, IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn multi_get_transactions_perpetual_checkpoints<'life0, 'life1, 'async_trait>(
        &'life0 self,
        digests: &'life1 [TransactionDigest],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<u64>>, IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn multi_get_events_by_tx_digests<'life0, 'life1, 'async_trait>(
        &'life0 self,
        digests: &'life1 [TransactionDigest],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<TransactionEvents>>, IotaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn evict_objects<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _object_keys: &'life1 [ObjectKey],
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: Sync + 'async_trait { ... }
    fn evict_events_by_tx_digests<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _digests: &'life1 [TransactionDigest],
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: Sync + 'async_trait { ... }
}
Expand description

Immutable key/value store trait for reading transactions, effects, events, checkpoints and objects, mostly with batched multi_get* methods.

Each batched method returns one entry per key, in key order, with None for a missing key.

Required Methods§

Source

fn multi_get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, transaction_keys: &'life1 [TransactionDigest], effects_keys: &'life2 [TransactionDigest], ) -> Pin<Box<dyn Future<Output = Result<(Vec<Option<Envelope<SenderSignedTransaction, EmptySignInfo>>>, Vec<Option<TransactionEffects>>), IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn multi_get_checkpoints<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, checkpoint_summaries: &'life1 [u64], checkpoint_contents: &'life2 [u64], checkpoint_summaries_by_digest: &'life3 [CheckpointDigest], ) -> Pin<Box<dyn Future<Output = Result<(Vec<Option<Envelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>>>, Vec<Option<CheckpointContents>>, Vec<Option<Envelope<CheckpointSummary, AuthorityQuorumSignInfo<true>>>>), IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Source

fn get_transaction_perpetual_checkpoint<'life0, 'async_trait>( &'life0 self, digest: TransactionDigest, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn get_object<'life0, 'async_trait>( &'life0 self, object_id: ObjectId, version: Version, ) -> Pin<Box<dyn Future<Output = Result<Option<Object>, IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn multi_get_objects<'life0, 'life1, 'async_trait>( &'life0 self, object_keys: &'life1 [ObjectKey], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Object>>, IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn multi_get_transactions_perpetual_checkpoints<'life0, 'life1, 'async_trait>( &'life0 self, digests: &'life1 [TransactionDigest], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<u64>>, IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn multi_get_events_by_tx_digests<'life0, 'life1, 'async_trait>( &'life0 self, digests: &'life1 [TransactionDigest], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<TransactionEvents>>, IotaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn evict_objects<'life0, 'life1, 'async_trait>( &'life0 self, _object_keys: &'life1 [ObjectKey], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Drops any cached copies of the objects at object_keys.

Source

fn evict_events_by_tx_digests<'life0, 'life1, 'async_trait>( &'life0 self, _digests: &'life1 [TransactionDigest], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: Sync + 'async_trait,

Drops any cached events of the transactions digests.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl TransactionKeyValueStoreTrait for FallbackTransactionKVStore

Source§

impl TransactionKeyValueStoreTrait for HttpKVStore

Source§

impl TransactionKeyValueStoreTrait for TransactionKeyValueStore

multi_get and multi_get_checkpoints record the same metrics as the inherent methods; the other methods go straight to the inner store.