Trait Storage

Source
pub trait Storage: Send + Sync {
    // Required methods
    fn insert_transactions<'life0, 'async_trait>(
        &'life0 self,
        signed_txs: Vec<SignedTransaction>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn insert_epoch<'life0, 'async_trait>(
        &'life0 self,
        epoch: Epoch,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn insert_receipts<'life0, 'async_trait>(
        &'life0 self,
        receipts: Vec<Receipt>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_latest_proof<'life0, 'async_trait>(
        &'life0 self,
        proof: Proof,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transaction_by_hash<'life0, 'async_trait>(
        &'life0 self,
        tx_hash: Hash,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<SignedTransaction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transactions<'life0, 'async_trait>(
        &'life0 self,
        hashes: Vec<Hash>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Vec<SignedTransaction>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_latest_epoch<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_epoch_by_epoch_id<'life0, 'async_trait>(
        &'life0 self,
        epoch_id: u64,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_epoch_by_hash<'life0, 'async_trait>(
        &'life0 self,
        epoch_hash: Hash,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_receipt<'life0, 'async_trait>(
        &'life0 self,
        hash: Hash,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Receipt>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_receipts<'life0, 'async_trait>(
        &'life0 self,
        hash: Vec<Hash>,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Vec<Receipt>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_latest_proof<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ProtocolResult<Proof>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn insert_transactions<'life0, 'async_trait>( &'life0 self, signed_txs: Vec<SignedTransaction>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn insert_epoch<'life0, 'async_trait>( &'life0 self, epoch: Epoch, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn insert_receipts<'life0, 'async_trait>( &'life0 self, receipts: Vec<Receipt>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_latest_proof<'life0, 'async_trait>( &'life0 self, proof: Proof, ) -> Pin<Box<dyn Future<Output = ProtocolResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_transaction_by_hash<'life0, 'async_trait>( &'life0 self, tx_hash: Hash, ) -> Pin<Box<dyn Future<Output = ProtocolResult<SignedTransaction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_transactions<'life0, 'async_trait>( &'life0 self, hashes: Vec<Hash>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Vec<SignedTransaction>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_latest_epoch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_epoch_by_epoch_id<'life0, 'async_trait>( &'life0 self, epoch_id: u64, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_epoch_by_hash<'life0, 'async_trait>( &'life0 self, epoch_hash: Hash, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Epoch>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_receipt<'life0, 'async_trait>( &'life0 self, hash: Hash, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Receipt>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_receipts<'life0, 'async_trait>( &'life0 self, hash: Vec<Hash>, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Vec<Receipt>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_latest_proof<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ProtocolResult<Proof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§