pub struct HoprDb { /* private fields */ }
Implementations§
Source§impl HoprDb
impl HoprDb
pub async fn new( directory: &Path, chain_key: ChainKeypair, cfg: HoprDbConfig, ) -> Result<Self>
pub async fn new_in_memory(chain_key: ChainKeypair) -> Result<Self>
Sourcepub fn start_ticket_processing(
&self,
ticket_notifier: Option<UnboundedSender<AcknowledgedTicket>>,
) -> Result<()>
pub fn start_ticket_processing( &self, ticket_notifier: Option<UnboundedSender<AcknowledgedTicket>>, ) -> Result<()>
Starts ticket processing by the [TicketManager] with an optional new ticket notifier. Without calling this method, tickets will not be persisted into the DB.
If the notifier is given, it will receive notifications once new ticket has been persisted into the Tickets DB.
Source§impl HoprDb
impl HoprDb
Sourcepub async fn upsert_ticket<'a>(
&'a self,
tx: OptTx<'a>,
acknowledged_ticket: AcknowledgedTicket,
) -> Result<()>
pub async fn upsert_ticket<'a>( &'a self, tx: OptTx<'a>, acknowledged_ticket: AcknowledgedTicket, ) -> Result<()>
Used only by non-SQLite code and tests.
Trait Implementations§
Source§impl HoprDbAccountOperations for HoprDb
impl HoprDbAccountOperations for HoprDb
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.
Source§fn get_accounts<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
public_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_accounts<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
public_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves entries of accounts with routable address announcements (if
public_only
is true
)
or about all accounts without routeable address announcements (if public_only
is false
).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 new account entry to the database.
Fails if such 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 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 HoprDb
impl HoprDbChannelOperations for HoprDb
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<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<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_channels_via<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
direction: ChannelDirection,
target: &'life0 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_channels_via<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
direction: ChannelDirection,
target: &'life0 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Fetches all channels that are
Incoming
to the given target
, or Outgoing
from the given target
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 channel information from the DB.
Source§fn stream_active_channels<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, Result<ChannelEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn stream_active_channels<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, Result<ChannelEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Returns a stream of all channels that are
Open
or PendingToClose
with an active grace period.sSource§impl HoprDbGeneralModelOperations for HoprDb
impl HoprDbGeneralModelOperations for HoprDb
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 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 HoprDb
impl HoprDbInfoOperations for HoprDb
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<Balance>> + 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<Balance>> + 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: Balance,
) -> 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: Balance,
) -> 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<Balance>> + 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<Balance>> + 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: Balance,
) -> 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: Balance,
) -> 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_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Option<SafeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Option<SafeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe addresses info.
Source§fn set_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
safe_info: SafeInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
safe_info: SafeInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe addresses info.
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: f64,
) -> 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: f64,
) -> 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: Balance,
) -> 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: Balance,
) -> 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 set_network_registry_enabled<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_network_registry_enabled<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the network registry state.
To retrieve the stored network registry state, use
HoprDbInfoOperations::get_indexer_data
,
note that this setter should invalidate the cache.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 HoprDb
impl HoprDbLogOperations for HoprDb
Source§fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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<()>> + 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<()>>>> + 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<()>>>> + 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>> + 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>> + 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>>> + 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>>> + 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>> + 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>> + 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>>> + 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>>> + 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<()>> + 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<()>> + 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<()>> + 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<()>> + 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<()>> + 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<()>> + 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>>> + 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>>> + 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>> + 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>> + 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<()>> + 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<()>> + 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
Source§impl HoprDbPeersOperations for HoprDb
impl HoprDbPeersOperations for HoprDb
Source§fn add_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
origin: PeerOrigin,
mas: Vec<Multiaddr>,
backoff: f64,
quality_window: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
origin: PeerOrigin,
mas: Vec<Multiaddr>,
backoff: f64,
quality_window: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Adds a peer to the backend. Read more
Source§fn remove_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes the peer from the backend. Read more
Source§fn update_network_peer<'life0, 'async_trait>(
&'life0 self,
new_status: PeerStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_network_peer<'life0, 'async_trait>(
&'life0 self,
new_status: PeerStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates stored information about the peer.
Should fail if the peer does not exist in the store.
Source§fn get_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets stored information about the peer. Read more
Source§fn get_network_peers<'a, 'async_trait>(
&'a self,
selector: PeerSelector,
sort_last_seen_asc: bool,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_network_peers<'a, 'async_trait>(
&'a self,
selector: PeerSelector,
sort_last_seen_asc: bool,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Returns a stream of all stored peers, optionally matching the given
PeerSelector
filter. Read moreSource§impl HoprDbProtocolOperations for HoprDb
impl HoprDbProtocolOperations for HoprDb
Source§fn handle_acknowledgement<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: Acknowledgement,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_acknowledgement<'life0, 'life1, 'async_trait>(
&'life0 self,
ack: Acknowledgement,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AckResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Processes the acknowledgements for the pending tickets Read more
Source§fn get_network_winning_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_winning_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<f64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads (presumably cached) value of the network’s minimum winning probability from the DB.
Source§fn get_network_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Balance>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads (presumably cached) value of the network’s minimum ticket price from the DB.
Source§fn to_send<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
me: ChainKeypair,
path: Vec<OffchainPublicKey>,
outgoing_ticket_win_prob: f64,
outgoing_ticket_price: Balance,
) -> Pin<Box<dyn Future<Output = Result<TransportPacketWithChainData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn to_send<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
me: ChainKeypair,
path: Vec<OffchainPublicKey>,
outgoing_ticket_win_prob: f64,
outgoing_ticket_price: Balance,
) -> Pin<Box<dyn Future<Output = Result<TransportPacketWithChainData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process the data into an outgoing packet
Source§fn from_recv<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
me: ChainKeypair,
pkt_keypair: &'life1 OffchainKeypair,
sender: OffchainPublicKey,
outgoing_ticket_win_prob: f64,
outgoing_ticket_price: Balance,
) -> Pin<Box<dyn Future<Output = Result<TransportPacketWithChainData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn from_recv<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
me: ChainKeypair,
pkt_keypair: &'life1 OffchainKeypair,
sender: OffchainPublicKey,
outgoing_ticket_win_prob: f64,
outgoing_ticket_price: Balance,
) -> Pin<Box<dyn Future<Output = Result<TransportPacketWithChainData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the incoming packet into data
Source§impl HoprDbRegistryOperations for HoprDb
impl HoprDbRegistryOperations for HoprDb
Source§fn set_access_in_network_registry<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
address: Address,
allowed: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_access_in_network_registry<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
address: Address,
allowed: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets the given node as allowed or denied in network registry.
Source§fn is_allowed_in_network_registry<'a, 'life0, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
address_like: &'life0 T,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
fn is_allowed_in_network_registry<'a, 'life0, 'async_trait, T>( &'a self, tx: OptTx<'a>, address_like: &'life0 T, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
Returns
true
if the given node is allowed in network registry.Source§impl HoprDbResolverOperations for HoprDb
impl HoprDbResolverOperations for HoprDb
Source§fn resolve_packet_key<'life0, 'life1, 'async_trait>(
&'life0 self,
onchain_key: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_packet_key<'life0, 'life1, 'async_trait>(
&'life0 self,
onchain_key: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Tries to resolve off-chain public key given the on-chain address
Source§fn resolve_chain_key<'life0, 'life1, 'async_trait>(
&'life0 self,
offchain_key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_chain_key<'life0, 'life1, 'async_trait>(
&'life0 self,
offchain_key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Tries to resolve on-chain public key given the off-chain public key
Source§impl HoprDbTicketOperations for HoprDb
impl HoprDbTicketOperations for HoprDb
Source§fn get_all_tickets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_tickets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve acknowledged winning tickets, according to the given
selector
. Read moreSource§fn get_tickets<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tickets<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve acknowledged winning tickets, according to the given
selector
. Read moreSource§fn mark_tickets_as<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
mark_as: TicketMarker,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mark_tickets_as<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
mark_as: TicketMarker,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks tickets as the given
TicketMarker
, removing them from the DB and updating the
ticket statistics for each ticket’s channel. Read moreSource§fn mark_unsaved_ticket_rejected<'life0, 'life1, 'async_trait>(
&'life0 self,
ticket: &'life1 Ticket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_unsaved_ticket_rejected<'life0, 'life1, 'async_trait>(
&'life0 self,
ticket: &'life1 Ticket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates the ticket statistics according to the fact that the given ticket has
been rejected by the packet processing pipeline. Read more
Source§fn update_ticket_states_and_fetch<'a, 'async_trait>(
&'a self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn update_ticket_states_and_fetch<'a, 'async_trait>(
&'a self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Source§fn update_ticket_states<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_ticket_states<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates state of the tickets matching the given
selector
.Source§fn get_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
channel_id: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<ChannelTicketStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
channel_id: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<ChannelTicketStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the ticket statistics for the given channel. Read more
Source§fn reset_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resets the ticket statistics about neglected, rejected, and redeemed tickets.
Source§fn get_tickets_value<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<(usize, Balance)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tickets_value<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<(usize, Balance)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Counts the tickets matching the given
selector
and their total value. Read moreSource§fn compare_and_set_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compare_and_set_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the stored outgoing ticket index to
index
, only if the currently stored value
is less than index
. This ensures the stored value can only be growing. Read moreSource§fn reset_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resets the outgoing ticket index to 0 for the given channel id. Read more
Source§fn increment_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn increment_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Increments the outgoing ticket index in the given channel ID and returns the value before incrementing. Read more
Source§fn get_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<Arc<AtomicU64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<Arc<AtomicU64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the current outgoing ticket index for the given channel id. Read more
Source§fn persist_outgoing_ticket_indices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn persist_outgoing_ticket_indices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compares outgoing ticket indices in the cache with the stored values
and updates the stored value where changed. Read more
Source§fn prepare_aggregation_in_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 Hash,
prerequisites: AggregationPrerequisites,
) -> Pin<Box<dyn Future<Output = Result<Option<(OffchainPublicKey, Vec<TransferableWinningTicket>, Hash)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare_aggregation_in_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 Hash,
prerequisites: AggregationPrerequisites,
) -> Pin<Box<dyn Future<Output = Result<Option<(OffchainPublicKey, Vec<TransferableWinningTicket>, Hash)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Prepare a viable collection of tickets to be aggregated. Read more
Source§fn rollback_aggregation_in_channel<'life0, 'async_trait>(
&'life0 self,
channel: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback_aggregation_in_channel<'life0, 'async_trait>(
&'life0 self,
channel: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a ticket aggregation rollback in the channel. Read more
Source§fn process_received_aggregated_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregated_ticket: Ticket,
chain_keypair: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AcknowledgedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_received_aggregated_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregated_ticket: Ticket,
chain_keypair: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AcknowledgedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replace the aggregated tickets locally with an aggregated ticket from the counterparty.
Source§fn aggregate_tickets<'life0, 'life1, 'async_trait>(
&'life0 self,
destination: OffchainPublicKey,
acked_tickets: Vec<TransferableWinningTicket>,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<VerifiedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn aggregate_tickets<'life0, 'life1, 'async_trait>(
&'life0 self,
destination: OffchainPublicKey,
acked_tickets: Vec<TransferableWinningTicket>,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<VerifiedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Performs ticket aggregation as an issuing party of the given tickets.
impl HoprDbAllOperations for HoprDb
Auto Trait Implementations§
impl !Freeze for HoprDb
impl !RefUnwindSafe for HoprDb
impl Send for HoprDb
impl Sync for HoprDb
impl Unpin for HoprDb
impl !UnwindSafe for HoprDb
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> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.