pub trait BatchOperations {
Show 13 methods // Required methods fn set_script_pubkey( &mut self, script: &Script, keychain: KeychainKind, child: u32 ) -> Result<(), Error>; fn set_utxo(&mut self, utxo: &LocalUtxo) -> Result<(), Error>; fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>; fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>; fn set_last_index( &mut self, keychain: KeychainKind, value: u32 ) -> Result<(), Error>; fn set_sync_time(&mut self, sync_time: SyncTime) -> Result<(), Error>; fn del_script_pubkey_from_path( &mut self, keychain: KeychainKind, child: u32 ) -> Result<Option<Script>, Error>; fn del_path_from_script_pubkey( &mut self, script: &Script ) -> Result<Option<(KeychainKind, u32)>, Error>; fn del_utxo( &mut self, outpoint: &OutPoint ) -> Result<Option<LocalUtxo>, Error>; fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>; fn del_tx( &mut self, txid: &Txid, include_raw: bool ) -> Result<Option<TransactionDetails>, Error>; fn del_last_index( &mut self, keychain: KeychainKind ) -> Result<Option<u32>, Error>; fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error>;
}
Expand description

Trait for operations that can be batched

This trait defines the list of operations that must be implemented on the Database type and the BatchDatabase::Batch type.

Required Methods§

source

fn set_script_pubkey( &mut self, script: &Script, keychain: KeychainKind, child: u32 ) -> Result<(), Error>

Store a script_pubkey along with its keychain and child number.

source

fn set_utxo(&mut self, utxo: &LocalUtxo) -> Result<(), Error>

Store a LocalUtxo

source

fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>

Store a raw transaction

source

fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>

Store the metadata of a transaction

source

fn set_last_index( &mut self, keychain: KeychainKind, value: u32 ) -> Result<(), Error>

Store the last derivation index for a given keychain.

source

fn set_sync_time(&mut self, sync_time: SyncTime) -> Result<(), Error>

Store the sync time

source

fn del_script_pubkey_from_path( &mut self, keychain: KeychainKind, child: u32 ) -> Result<Option<Script>, Error>

Delete a script_pubkey given the keychain and its child number.

source

fn del_path_from_script_pubkey( &mut self, script: &Script ) -> Result<Option<(KeychainKind, u32)>, Error>

Delete the data related to a specific script_pubkey, meaning the keychain and the child number.

source

fn del_utxo(&mut self, outpoint: &OutPoint) -> Result<Option<LocalUtxo>, Error>

Delete a LocalUtxo given its OutPoint

source

fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>

Delete a raw transaction given its Txid

source

fn del_tx( &mut self, txid: &Txid, include_raw: bool ) -> Result<Option<TransactionDetails>, Error>

Delete the metadata of a transaction and optionally the raw transaction itself

source

fn del_last_index( &mut self, keychain: KeychainKind ) -> Result<Option<u32>, Error>

Delete the last derivation index for a keychain.

source

fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error>

Reset the sync time to None

Returns the removed value

Implementations on Foreign Types§

source§

impl BatchOperations for Tree

source§

fn set_script_pubkey( &mut self, script: &Script, keychain: KeychainKind, path: u32 ) -> Result<(), Error>

source§

fn set_utxo(&mut self, utxo: &LocalUtxo) -> Result<(), Error>

source§

fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>

source§

fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>

source§

fn set_last_index( &mut self, keychain: KeychainKind, value: u32 ) -> Result<(), Error>

source§

fn set_sync_time(&mut self, data: SyncTime) -> Result<(), Error>

source§

fn del_script_pubkey_from_path( &mut self, keychain: KeychainKind, path: u32 ) -> Result<Option<Script>, Error>

source§

fn del_path_from_script_pubkey( &mut self, script: &Script ) -> Result<Option<(KeychainKind, u32)>, Error>

source§

fn del_utxo(&mut self, outpoint: &OutPoint) -> Result<Option<LocalUtxo>, Error>

source§

fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>

source§

fn del_tx( &mut self, txid: &Txid, include_raw: bool ) -> Result<Option<TransactionDetails>, Error>

source§

fn del_last_index( &mut self, keychain: KeychainKind ) -> Result<Option<u32>, Error>

source§

fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error>

source§

impl BatchOperations for Batch

source§

fn set_script_pubkey( &mut self, script: &Script, keychain: KeychainKind, path: u32 ) -> Result<(), Error>

source§

fn set_utxo(&mut self, utxo: &LocalUtxo) -> Result<(), Error>

source§

fn set_raw_tx(&mut self, transaction: &Transaction) -> Result<(), Error>

source§

fn set_tx(&mut self, transaction: &TransactionDetails) -> Result<(), Error>

source§

fn set_last_index( &mut self, keychain: KeychainKind, value: u32 ) -> Result<(), Error>

source§

fn set_sync_time(&mut self, data: SyncTime) -> Result<(), Error>

source§

fn del_script_pubkey_from_path( &mut self, keychain: KeychainKind, path: u32 ) -> Result<Option<Script>, Error>

source§

fn del_path_from_script_pubkey( &mut self, script: &Script ) -> Result<Option<(KeychainKind, u32)>, Error>

source§

fn del_utxo(&mut self, outpoint: &OutPoint) -> Result<Option<LocalUtxo>, Error>

source§

fn del_raw_tx(&mut self, txid: &Txid) -> Result<Option<Transaction>, Error>

source§

fn del_tx( &mut self, txid: &Txid, include_raw: bool ) -> Result<Option<TransactionDetails>, Error>

source§

fn del_last_index( &mut self, keychain: KeychainKind ) -> Result<Option<u32>, Error>

source§

fn del_sync_time(&mut self) -> Result<Option<SyncTime>, Error>

Implementors§