pub struct HoprIndexerDb {
pub me_onchain: Address,
/* private fields */
}
Expand description
Main database handle for HOPR node operations.
Manages multiple SQLite databases for different data domains to avoid locking conflicts and improve performance:
- Index DB: Blockchain indexing and contract data
- Tickets DB: Payment tickets and acknowledgments
- Peers DB: Network peer information and metadata
- Logs DB: Blockchain logs and processing status
Supports database snapshot imports for fast synchronization via
[HoprDbGeneralModelOperations::import_logs_db
].
Fields§
§me_onchain: Address
Implementations§
Source§impl HoprIndexerDb
impl HoprIndexerDb
pub async fn resolve_packet_key( &self, onchain_key: &Address, ) -> Result<Option<OffchainPublicKey>>
pub async fn resolve_chain_key( &self, offchain_key: &OffchainPublicKey, ) -> Result<Option<Address>>
Source§impl HoprIndexerDb
impl HoprIndexerDb
pub async fn new( directory: &Path, chain_key: ChainKeypair, cfg: HoprIndexerDbConfig, ) -> Result<Self>
pub async fn new_in_memory(chain_key: ChainKeypair) -> Result<Self>
pub async fn create_pool( cfg: HoprIndexerDbConfig, directory: PathBuf, options: PoolOptions<Sqlite>, min_conn: Option<u32>, max_conn: Option<u32>, read_only: bool, path: &str, ) -> Result<SqlitePool>
pub fn key_id_mapper_ref(&self) -> &CacheKeyMapper
Trait Implementations§
Source§impl Clone for HoprIndexerDb
impl Clone for HoprIndexerDb
Source§fn clone(&self) -> HoprIndexerDb
fn clone(&self) -> HoprIndexerDb
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HoprIndexerDb
impl Debug for HoprIndexerDb
Source§impl HoprDbAccountOperations for HoprIndexerDb
impl HoprDbAccountOperations for HoprIndexerDb
Source§fn get_account<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>>> + Send + 'async_trait>>
fn get_account<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>>> + Send + 'async_trait>>
Retrieves the account entry using a Packet key or Chain key.
Source§fn get_self_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_self_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves account entry about this node’s account.
This a unique account in the database that must always be present.
fn stream_accounts<'a, 'async_trait>(
&'a self,
public_only: bool,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AccountEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Source§fn insert_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
account: AccountEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn insert_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
account: AccountEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Inserts a new account entry to the database.
Fails if such an entry already exists.
Source§fn insert_announcement<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
multiaddr: Multiaddr,
at_block: u32,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>
fn insert_announcement<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, multiaddr: Multiaddr, at_block: u32, ) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>
Inserts a routable address announcement linked to a specific entry. Read more
Source§fn delete_all_announcements<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_all_announcements<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Deletes all address announcements for the given account.
Source§fn delete_account<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_account<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Deletes account with the given
key
(chain or off-chain).Source§impl HoprDbChannelOperations for HoprIndexerDb
impl HoprDbChannelOperations for HoprIndexerDb
Source§fn get_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Retrieves channel by its channel ID hash. Read more
Source§fn begin_channel_update<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEditor>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn begin_channel_update<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEditor>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Start changes to channel entry.
If the channel with the given ID exists, the ChannelEditor is returned.
Use
HoprDbChannelOperations::finish_channel_update
to commit edits to the DB when done.Source§fn finish_channel_update<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
editor: ChannelEditor,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn finish_channel_update<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
editor: ChannelEditor,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Commits changes of the channel to the database.
Returns the updated channel, or on deletion, the deleted channel entry.
Source§fn get_channel_by_parties<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
src: &'life0 Address,
dst: &'life1 Address,
use_cache: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_channel_by_parties<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
src: &'life0 Address,
dst: &'life1 Address,
use_cache: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the channel by source and destination.
This operation should be able to use cache since it can be also called from
performance-sensitive locations.
Source§fn get_incoming_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_incoming_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Fetches all channels that are
Incoming
to this node.
Shorthand for get_channels_via(tx, ChannelDirection::Incoming, my_node)
Source§fn get_outgoing_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_outgoing_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Fetches all channels that are
Outgoing
from this node.
Shorthand for get_channels_via(tx, ChannelDirection::Outgoing, my_node)
Source§fn get_all_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_all_channels<'a, 'async_trait>(
&'a self,
_tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves all channels information from the DB.
fn stream_channels<'a, 'life0, 'async_trait, T>(
&'a self,
source: Option<Address>,
destination: Option<Address>,
states: &'life0 [ChannelStatusDiscriminants],
closure_range: T,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, ChannelEntry>>> + Send + 'async_trait>>where
T: 'async_trait + RangeBounds<DateTime<Utc>> + Send,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Source§impl HoprDbCorruptedChannelOperations for HoprIndexerDb
impl HoprDbCorruptedChannelOperations for HoprIndexerDb
Source§fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Retrieves corrupted channel by its channel ID hash. Read more
Source§impl HoprDbGeneralModelOperations for HoprIndexerDb
impl HoprDbGeneralModelOperations for HoprIndexerDb
Source§fn conn(&self, target_db: TargetDb) -> &DatabaseConnection
fn conn(&self, target_db: TargetDb) -> &DatabaseConnection
Retrieves raw database connection to the given DB.
Source§fn begin_transaction_in_db<'life0, 'async_trait>(
&'life0 self,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction_in_db<'life0, 'async_trait>(
&'life0 self,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts a new transaction in the given DB.
Source§fn import_logs_db<'async_trait>(
self,
src_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn import_logs_db<'async_trait>(
self,
src_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Import logs database from a snapshot directory. Read more
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Same as
HoprDbGeneralModelOperations::begin_transaction_in_db
with default TargetDb.Source§fn nest_transaction_in_db<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nest_transaction_in_db<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a nested transaction inside the given transaction. Read more
Source§fn nest_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nest_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Same as
HoprDbGeneralModelOperations::nest_transaction_in_db
with default TargetDb.Source§impl HoprDbInfoOperations for HoprIndexerDb
impl HoprDbInfoOperations for HoprIndexerDb
Source§fn index_is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index_is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if the index is empty. Read more
Source§fn clear_index_db<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn clear_index_db<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Removes all data from all tables in the index database. Read more
Source§fn get_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe balance of HOPR tokens.
Source§fn set_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_balance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_balance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe balance of HOPR tokens.
Source§fn get_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe allowance of HOPR tokens.
Source§fn set_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_allowance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_allowance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe allowance of HOPR tokens.
Source§fn get_indexer_data<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerData>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_indexer_data<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerData>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets stored Indexer data (either from the cache or from the DB). Read more
Source§fn set_domain_separator<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
dst_type: DomainSeparator,
value: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_domain_separator<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
dst_type: DomainSeparator,
value: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets a domain separator. Read more
Source§fn set_minimum_incoming_ticket_win_prob<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
win_prob: WinningProbability,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_minimum_incoming_ticket_win_prob<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
win_prob: WinningProbability,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets the minimum required winning probability for incoming tickets.
The value must be between zero and 1.
Source§fn update_ticket_price<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn update_ticket_price<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the ticket price.
To retrieve the stored ticket price, use
HoprDbInfoOperations::get_indexer_data
,
note that this setter should invalidate the cache.Source§fn get_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerStateInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerStateInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets the indexer state info.
Source§fn set_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
block_num: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
block_num: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the indexer state info.
Source§fn get_global_setting<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<[u8]>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_global_setting<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<[u8]>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Gets global setting value with the given key.
Source§fn set_global_setting<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
value: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_global_setting<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
value: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sets the global setting value with the given key. Read more
Source§impl HoprDbLogOperations for HoprIndexerDb
impl HoprDbLogOperations for HoprIndexerDb
Source§fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Stores a single log entry in the database. Read more
Source§fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(), DbSqlError>>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(), DbSqlError>>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores multiple log entries in the database. Read more
Source§fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a specific log entry from the database. Read more
Source§fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves multiple log entries from the database. Read more
Source§fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the count of log entries from the database. Read more
Source§fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves block numbers of log entries from the database. Read more
Source§fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks multiple log entries as processed. Read more
Source§fn set_log_processed<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_log_processed<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Marks a specific log entry as processed. Read more
Source§fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks multiple log entries as unprocessed. Read more
Source§fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the last checksummed log entry from the database. Read more
Source§fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash, DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates checksums for log entries in the database. Read more
Source§fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<(), DbSqlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ensures that logs in this database have been created by scanning the given contract address
and their corresponding topics. If the log DB is empty, the given addresses and topics
are used to prime the table. Read more
Auto Trait Implementations§
impl Freeze for HoprIndexerDb
impl !RefUnwindSafe for HoprIndexerDb
impl Send for HoprIndexerDb
impl Sync for HoprIndexerDb
impl Unpin for HoprIndexerDb
impl !UnwindSafe for HoprIndexerDb
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more