ProvidesTransactions

Trait ProvidesTransactions 

Source
pub trait ProvidesTransactions: Sync {
    // Required methods
    fn transactions(
        &self,
        hashes: &[[u8; 32]],
    ) -> impl Send + Future<Output = Result<Vec<Transaction>, TransactionsError>>;
    fn pruned_transactions(
        &self,
        hashes: &[[u8; 32]],
    ) -> impl Send + Future<Output = Result<Vec<Transaction<Pruned>>, TransactionsError>>;
    fn transaction(
        &self,
        hash: [u8; 32],
    ) -> impl Send + Future<Output = Result<Transaction, TransactionsError>>;
    fn pruned_transaction(
        &self,
        hash: [u8; 32],
    ) -> impl Send + Future<Output = Result<Transaction<Pruned>, TransactionsError>>;
}
Expand description

Provides transactions which have been sanity-checked.

Required Methods§

Source

fn transactions( &self, hashes: &[[u8; 32]], ) -> impl Send + Future<Output = Result<Vec<Transaction>, TransactionsError>>

Get transactions.

This returns all of the requested deserialized transactions, ensuring they’re the requested transactions.

Source

fn pruned_transactions( &self, hashes: &[[u8; 32]], ) -> impl Send + Future<Output = Result<Vec<Transaction<Pruned>>, TransactionsError>>

Get pruned transactions.

This returns all of the requested deserialized transactions, ensuring they’re the requested transactions. For transactions where version == 1, this may additionally request the non-pruned transactions.

Source

fn transaction( &self, hash: [u8; 32], ) -> impl Send + Future<Output = Result<Transaction, TransactionsError>>

Get a transaction.

This returns the requested transaction, ensuring it is the requested transaction.

Source

fn pruned_transaction( &self, hash: [u8; 32], ) -> impl Send + Future<Output = Result<Transaction<Pruned>, TransactionsError>>

Get a pruned transaction.

This returns the requested transaction, ensuring it is the requested transaction. For transactions where version == 1, this may additionally request the non-pruned transactions.

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§