pub struct DatabaseHandler {
pool: Arc<DbPool>,
}Expand description
Synchronous persistence handler. Owns an r2d2 connection pool and
implements all engine-path traits from hypercall_db (orders,
instruments, tiers, settlements, journal replay, archiver, RFQ).
Constructors run Diesel migrations and ensure_enum_values by default.
Use Self::new_readonly or Self::with_pool_no_migrations to skip.
Fields§
§pool: Arc<DbPool>Implementations§
Source§impl DatabaseHandler
impl DatabaseHandler
Sourcepub fn new(database_url: &str) -> Result<Self>
pub fn new(database_url: &str) -> Result<Self>
Create a new handler: build pool + run migrations.
Sourcepub fn new_with_pool_size(database_url: &str, pool_max: u32) -> Result<Self>
pub fn new_with_pool_size(database_url: &str, pool_max: u32) -> Result<Self>
Create a new handler with explicit pool size: build pool + run migrations.
Sourcepub fn new_with_auth(auth: DbAuthConfig, pool_max: u32) -> Result<Self>
pub fn new_with_auth(auth: DbAuthConfig, pool_max: u32) -> Result<Self>
Create a new handler with DbAuthConfig: build pool + run migrations.
Sourcepub fn new_with_timeouts(
database_url: &str,
pool_max: u32,
statement_timeout_ms: u32,
lock_timeout_ms: u32,
) -> Result<Self>
pub fn new_with_timeouts( database_url: &str, pool_max: u32, statement_timeout_ms: u32, lock_timeout_ms: u32, ) -> Result<Self>
Create a handler with custom statement/lock timeouts, no migrations. Used by db-archiver which needs longer timeouts for batch operations.
Sourcepub fn new_with_timeouts_auth(
auth: DbAuthConfig,
pool_max: u32,
statement_timeout_ms: u32,
lock_timeout_ms: u32,
) -> Result<Self>
pub fn new_with_timeouts_auth( auth: DbAuthConfig, pool_max: u32, statement_timeout_ms: u32, lock_timeout_ms: u32, ) -> Result<Self>
Create a handler with custom timeouts and DbAuthConfig, no migrations.
Sourcepub fn new_readonly(database_url: &str, pool_max: u32) -> Result<Self>
pub fn new_readonly(database_url: &str, pool_max: u32) -> Result<Self>
Create a handler with pool only, no migrations (for read-only replicas).
Sourcepub fn new_readonly_auth(auth: DbAuthConfig, pool_max: u32) -> Result<Self>
pub fn new_readonly_auth(auth: DbAuthConfig, pool_max: u32) -> Result<Self>
Create a readonly handler with DbAuthConfig, no migrations.
Sourcepub fn with_pool_no_migrations(pool: Arc<DbPool>) -> Self
pub fn with_pool_no_migrations(pool: Arc<DbPool>) -> Self
Wrap an existing pool, skip migrations.
Sourcepub fn run_migrations(&self) -> Result<()>
pub fn run_migrations(&self) -> Result<()>
Run pending Diesel migrations + ensure enum values.
fn ensure_real_liquidation_schema(conn: &mut PgConnection) -> Result<()>
fn build_pool( auth: &DbAuthConfig, pool_max: u32, statement_timeout_ms: u32, lock_timeout_ms: u32, ) -> Result<Self>
Sourcefn ensure_enum_values(conn: &mut PgConnection) -> Result<()>
fn ensure_enum_values(conn: &mut PgConnection) -> Result<()>
Ensure all required Postgres enum values exist.
Sourcefn ensure_directive_action_key_enum(conn: &mut PgConnection) -> Result<()>
fn ensure_directive_action_key_enum(conn: &mut PgConnection) -> Result<()>
Ensure the directive outbox action-key enum exists even if an older duplicate-version migration was recorded before this enum migration ran.
fn ensure_directive_outbox_wallet_address(conn: &mut PgConnection) -> Result<()>
Sourcepub(crate) fn order_update_status_to_db(
status: OrderUpdateStatus,
) -> &'static str
pub(crate) fn order_update_status_to_db( status: OrderUpdateStatus, ) -> &'static str
Map an OrderUpdateStatus enum to its DB string representation.
Sourcepub(crate) fn observe_diesel_option_token_violation(err: &Error)
pub(crate) fn observe_diesel_option_token_violation(err: &Error)
Log and count option_token_address unique constraint violations.
Sourcepub fn update_snapshot_boundary_sync(&self, last_command_id: i64) -> Result<()>
pub fn update_snapshot_boundary_sync(&self, last_command_id: i64) -> Result<()>
Persist the engine state snapshot’s last_command_id to Postgres so the db-archiver can compute a safe deletion boundary. Must be called after every successful snapshot write to disk.
Sourcepub fn directive_outbox_exists_sync(&self, directive_id: &str) -> Result<bool>
pub fn directive_outbox_exists_sync(&self, directive_id: &str) -> Result<bool>
Check whether a directive outbox row exists for the given directive_id.
Sourcepub async fn get_max_rsm_deposit_credit_observed_block(
&self,
) -> Result<Option<u64>>
pub async fn get_max_rsm_deposit_credit_observed_block( &self, ) -> Result<Option<u64>>
Get the maximum observed block from rsm_deposit_credits.
Sourcepub async fn ensure_observed_deposit_account(
&self,
account: &WalletAddress,
) -> Result<()>
pub async fn ensure_observed_deposit_account( &self, account: &WalletAddress, ) -> Result<()>
Ensure a user_tiers row exists for the wallet that will receive deposit credit.
Sourcepub async fn claim_rsm_deposit_credit(
&self,
input: &RsmDepositCreditClaimInput,
) -> Result<RsmDepositCreditClaimRecord>
pub async fn claim_rsm_deposit_credit( &self, input: &RsmDepositCreditClaimInput, ) -> Result<RsmDepositCreditClaimRecord>
Claim an RSM deposit credit (idempotent upsert).
Sourcepub async fn mark_rsm_deposit_credit_submitted(
&self,
request_id: &str,
) -> Result<()>
pub async fn mark_rsm_deposit_credit_submitted( &self, request_id: &str, ) -> Result<()>
Mark an RSM deposit credit as submitted.
Sourcepub async fn mark_rsm_deposit_credit_failed(
&self,
request_id: &str,
error: &str,
) -> Result<()>
pub async fn mark_rsm_deposit_credit_failed( &self, request_id: &str, error: &str, ) -> Result<()>
Mark an RSM deposit credit as failed.
Sourcepub async fn pending_rsm_usdc_deposit_for_amount(
&self,
amount_wei: &str,
) -> Result<Option<RsmUsdcDepositMatch>>
pub async fn pending_rsm_usdc_deposit_for_amount( &self, amount_wei: &str, ) -> Result<Option<RsmUsdcDepositMatch>>
Return the oldest pending Exchange.UsdcDeposit event for a HyperCore cash amount.
Sourcepub async fn pending_rsm_usdc_deposit_for_evm_tx_hash(
&self,
evm_tx_hash: &str,
amount_wei: &str,
) -> Result<Option<RsmUsdcDepositMatch>>
pub async fn pending_rsm_usdc_deposit_for_evm_tx_hash( &self, evm_tx_hash: &str, amount_wei: &str, ) -> Result<Option<RsmUsdcDepositMatch>>
Return the pending Exchange.UsdcDeposit event for a CoreWriter writer-action EVM tx hash.
Sourcepub async fn pm_liquidity_deposit_for_evm_tx_hash(
&self,
evm_tx_hash: &str,
amount_wei: &str,
) -> Result<Option<RsmUsdcDepositMatch>>
pub async fn pm_liquidity_deposit_for_evm_tx_hash( &self, evm_tx_hash: &str, amount_wei: &str, ) -> Result<Option<RsmUsdcDepositMatch>>
Return a PM liquidity Exchange deposit by CoreWriter writer-action EVM tx hash.
Sourcepub async fn pm_liquidity_deposit_for_amount(
&self,
amount_wei: &str,
) -> Result<Option<RsmUsdcDepositMatch>>
pub async fn pm_liquidity_deposit_for_amount( &self, amount_wei: &str, ) -> Result<Option<RsmUsdcDepositMatch>>
Return the oldest PM liquidity Exchange deposit for a HyperCore cash amount.
Sourcepub async fn mark_pm_liquidity_deposit_hypercore_matched(
&self,
request_id: &str,
event_hash: &str,
) -> Result<()>
pub async fn mark_pm_liquidity_deposit_hypercore_matched( &self, request_id: &str, event_hash: &str, ) -> Result<()>
Mark a PM liquidity Exchange deposit as consumed by a HyperCore cash event.
Sourcepub async fn pending_rsm_usdc_deposit_for_credited_hypercore_event(
&self,
event_hash: &str,
amount_wei: &str,
) -> Result<Option<RsmUsdcDepositMatch>>
pub async fn pending_rsm_usdc_deposit_for_credited_hypercore_event( &self, event_hash: &str, amount_wei: &str, ) -> Result<Option<RsmUsdcDepositMatch>>
Return a pending Exchange.UsdcDeposit request for an already credited HyperCore event.
Sourcepub async fn credited_wallet_for_hypercore_cash_event(
&self,
event_hash: &str,
) -> Result<Option<WalletAddress>>
pub async fn credited_wallet_for_hypercore_cash_event( &self, event_hash: &str, ) -> Result<Option<WalletAddress>>
Return the credited wallet for an already-applied HyperCore cash event.
Sourcepub async fn non_crediting_hypercore_cash_event(
&self,
event_hash: &str,
amount_usdc: Decimal,
) -> Result<bool>
pub async fn non_crediting_hypercore_cash_event( &self, event_hash: &str, amount_usdc: Decimal, ) -> Result<bool>
Return true when this HyperCore cash event is already recorded as non-crediting.
Sourcepub async fn list_recent_cash_deposit_monitoring_rows(
&self,
limit: i64,
offset: i64,
) -> Result<Vec<DepositMonitoringRow>>
pub async fn list_recent_cash_deposit_monitoring_rows( &self, limit: i64, offset: i64, ) -> Result<Vec<DepositMonitoringRow>>
Return recent cash deposit attribution rows for the admin panel.
Sourcepub async fn apply_hypercore_cash_deposit(
&self,
input: &HypercoreCashLedgerApply,
) -> Result<HypercoreCashLedgerApplyResult>
pub async fn apply_hypercore_cash_deposit( &self, input: &HypercoreCashLedgerApply, ) -> Result<HypercoreCashLedgerApplyResult>
Apply a HyperCore cash deposit (idempotent).
Sourcepub async fn record_hypercore_cash_deposit_non_crediting(
&self,
input: &HypercoreCashLedgerApply,
) -> Result<()>
pub async fn record_hypercore_cash_deposit_non_crediting( &self, input: &HypercoreCashLedgerApply, ) -> Result<()>
Record an observed Exchange HyperCore deposit that must not credit engine cash.
Sourcepub async fn record_hypercore_cash_deposit_pending_margin_mode(
&self,
input: &HypercoreCashLedgerApply,
) -> Result<()>
pub async fn record_hypercore_cash_deposit_pending_margin_mode( &self, input: &HypercoreCashLedgerApply, ) -> Result<()>
Record a HyperCore cash deposit that cannot yet be credited because margin mode is unknown. The row pins the replay watermark until a later replay can apply the credit with a durable ledger sequence.
Sourcepub fn get_exchange_cash_ledger_watermark_sync(&self) -> Result<Option<i64>>
pub fn get_exchange_cash_ledger_watermark_sync(&self) -> Result<Option<i64>>
Get the exchange-wide cash ledger watermark (max event_time_ms).
Sourcepub async fn get_rsm_signer_nonce(
&self,
signer: &WalletAddress,
) -> Result<Option<RsmSignerNonceRecord>>
pub async fn get_rsm_signer_nonce( &self, signer: &WalletAddress, ) -> Result<Option<RsmSignerNonceRecord>>
Load the current nonce state for a signer address (sync, used by startup code).
Sourcepub async fn get_option_instrument_for_credit(
&self,
token: &WalletAddress,
) -> Result<Option<OptionInstrumentForCredit>>
pub async fn get_option_instrument_for_credit( &self, token: &WalletAddress, ) -> Result<Option<OptionInstrumentForCredit>>
Look up an option instrument by its on-chain token address.
Source§impl DatabaseHandler
impl DatabaseHandler
Sourcepub(crate) fn upsert_order_info(
conn: &mut PgConnection,
info: &NewOrderInfo,
) -> Result<()>
pub(crate) fn upsert_order_info( conn: &mut PgConnection, info: &NewOrderInfo, ) -> Result<()>
Upsert static order info into order_infos. Used by handle_event_with_conn
and the OrderWriter trait impl.
Sourcepub(crate) fn insert_order_action(
conn: &mut PgConnection,
action: &NewOrderAction,
) -> Result<()>
pub(crate) fn insert_order_action( conn: &mut PgConnection, action: &NewOrderAction, ) -> Result<()>
Insert an order action audit trail entry. Used by handle_event_with_conn
and the OrderWriter trait impl.
Sourcepub fn handle_event_sync(&self, event: &EngineMessage) -> Result<()>
pub fn handle_event_sync(&self, event: &EngineMessage) -> Result<()>
Persist a single engine event, acquiring a connection from the pool.
Sourcepub fn handle_event_batch_sync(&self, events: &[EngineMessage]) -> Result<()>
pub fn handle_event_batch_sync(&self, events: &[EngineMessage]) -> Result<()>
Persist a batch of engine events in a single transaction.
Sourcepub fn handle_event_with_conn(
&self,
conn: &mut PgConnection,
event: &EngineMessage,
) -> Result<()>
pub fn handle_event_with_conn( &self, conn: &mut PgConnection, event: &EngineMessage, ) -> Result<()>
Persist a single engine event using the provided connection.
Sourcepub fn batch_cancel_expired_orders_sync(
&self,
cancels: &[ExpiredOrderCancel],
reason: &str,
) -> Result<usize>
pub fn batch_cancel_expired_orders_sync( &self, cancels: &[ExpiredOrderCancel], reason: &str, ) -> Result<usize>
Batch-insert CANCELED rows into order_updates for orders on expired instruments. Skips orders that already have a terminal status (CANCELED, FILLED, REJECTED) in order_infos for idempotency.
Runs as a single serializable transaction with retry.
fn save_liquidation_state_with_conn( &self, conn: &mut PgConnection, state: &NewLiquidationState, ) -> Result<()>
fn insert_liquidation_history_with_conn( &self, conn: &mut PgConnection, entry: &NewLiquidationHistory, ) -> Result<i64>
fn upsert_liquidation_auction_with_conn( &self, conn: &mut PgConnection, auction: &NewLiquidationAuction, ) -> Result<()>
fn update_liquidation_auction_with_conn( &self, conn: &mut PgConnection, auction_id: &str, update: &UpdateLiquidationAuction, ) -> Result<()>
fn get_liquidation_auction_with_conn( &self, conn: &mut PgConnection, auction_id: &str, ) -> Result<Option<LiquidationAuctionRecord>>
Sourcefn persist_transaction_update(
conn: &mut PgConnection,
tx_update: &TransactionUpdate,
) -> Result<()>
fn persist_transaction_update( conn: &mut PgConnection, tx_update: &TransactionUpdate, ) -> Result<()>
Update directive outbox status from a transaction lifecycle event. Withdrawal failures are not auto-refunded here. Until withdrawal proofs are user-driven, terminal withdrawal states require manual reconciliation.
Source§impl DatabaseHandler
impl DatabaseHandler
pub(crate) fn apply_fill_ledger_side_effects( conn: &mut PgConnection, wallet: &WalletAddress, fill: &Fill, realized_delta: Decimal, premium_delta: Decimal, ) -> Result<()>
Trait Implementations§
Source§impl ArchiverReader for DatabaseHandler
impl ArchiverReader for DatabaseHandler
Source§fn find_safe_boundary(&self, min_age_hours: i64) -> Result<ArchivalBoundary>
fn find_safe_boundary(&self, min_age_hours: i64) -> Result<ArchivalBoundary>
last_command_id and the configured minimum age.Source§fn fetch_events_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_event_id: Option<i64>,
) -> Result<Vec<ArchivedEvent>>
fn fetch_events_batch( &self, max_command_id: i64, age_cutoff: &DateTime<Utc>, batch_size: i64, after_event_id: Option<i64>, ) -> Result<Vec<ArchivedEvent>>
Source§fn fetch_orphan_commands_batch(
&self,
max_command_id: i64,
age_cutoff: &DateTime<Utc>,
batch_size: i64,
after_command_id: Option<i64>,
) -> Result<Vec<ArchivedCommand>>
fn fetch_orphan_commands_batch( &self, max_command_id: i64, age_cutoff: &DateTime<Utc>, batch_size: i64, after_command_id: Option<i64>, ) -> Result<Vec<ArchivedCommand>>
Source§impl ArchiverWriter for DatabaseHandler
impl ArchiverWriter for DatabaseHandler
Source§fn delete_events(&self, event_ids: &[i64]) -> Result<usize>
fn delete_events(&self, event_ids: &[i64]) -> Result<usize>
Source§fn delete_commands(&self, command_ids: &[i64]) -> Result<usize>
fn delete_commands(&self, command_ids: &[i64]) -> Result<usize>
Source§fn delete_order_actions(&self, ids: &[i32]) -> Result<usize>
fn delete_order_actions(&self, ids: &[i32]) -> Result<usize>
Source§fn delete_order_updates(&self, ids: &[i32]) -> Result<usize>
fn delete_order_updates(&self, ids: &[i32]) -> Result<usize>
Source§impl DirectiveOutboxReader for DatabaseHandler
impl DirectiveOutboxReader for DatabaseHandler
fn claim_next_directive_outbox_item_sync( &self, ) -> Result<Option<DirectiveOutboxRow>>
Source§fn get_directive_status_sync(
&self,
directive_id: &str,
) -> Result<Option<DirectiveStatusRow>>
fn get_directive_status_sync( &self, directive_id: &str, ) -> Result<Option<DirectiveStatusRow>>
Source§fn get_withdrawal_history_sync(
&self,
wallet: &WalletAddress,
limit: i64,
) -> Result<Vec<DirectiveStatusRow>>
fn get_withdrawal_history_sync( &self, wallet: &WalletAddress, limit: i64, ) -> Result<Vec<DirectiveStatusRow>>
Source§fn list_directive_outbox_delivery_metrics_sync(
&self,
) -> Result<Vec<DirectiveOutboxDeliveryMetricsRow>>
fn list_directive_outbox_delivery_metrics_sync( &self, ) -> Result<Vec<DirectiveOutboxDeliveryMetricsRow>>
Source§impl DirectiveOutboxWriter for DatabaseHandler
impl DirectiveOutboxWriter for DatabaseHandler
fn mark_directive_outbox_delivery_failed_sync( &self, outbox_seq: i64, error: &str, ) -> Result<()>
fn mark_directive_outbox_dead_lettered_sync( &self, outbox_seq: i64, error: &str, ) -> Result<()>
Source§fn mark_directive_outbox_manual_reconciliation_sync(
&self,
outbox_seq: i64,
error: &str,
) -> Result<()>
fn mark_directive_outbox_manual_reconciliation_sync( &self, outbox_seq: i64, error: &str, ) -> Result<()>
Source§impl EngineJournalBatchWriter for DatabaseHandler
impl EngineJournalBatchWriter for DatabaseHandler
fn insert_engine_journal_batch_sync( &self, entries: &[EngineJournalEntryInsert], persist_digests: bool, rsm_blocks: Option<&EngineJournalRsmBlockBatch>, ) -> Result<EngineJournalBatchInsertResult>
fn lookup_engine_journal_command_ids_sync( &self, request_ids: &[Uuid], ) -> Result<Vec<(Uuid, i64)>>
Source§impl InstrumentReader for DatabaseHandler
impl InstrumentReader for DatabaseHandler
Source§fn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>
fn get_all_instruments_sync(&self) -> Result<Vec<InstrumentRecord>>
Source§fn get_instruments_by_status_sync(
&self,
status: &str,
) -> Result<Vec<InstrumentRecord>>
fn get_instruments_by_status_sync( &self, status: &str, ) -> Result<Vec<InstrumentRecord>>
Source§fn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>
fn get_instrument_status_counts_sync(&self) -> Result<Vec<(String, i64)>>
Source§impl InstrumentWriter for DatabaseHandler
impl InstrumentWriter for DatabaseHandler
Source§fn save_market_and_instrument_sync(
&self,
underlying: &str,
expiry: i64,
instrument: &InstrumentRecord,
) -> Result<()>
fn save_market_and_instrument_sync( &self, underlying: &str, expiry: i64, instrument: &InstrumentRecord, ) -> Result<()>
update_instrument_status_sync.Source§fn delete_market_and_instrument_sync(&self, symbol: &str) -> Result<()>
fn delete_market_and_instrument_sync(&self, symbol: &str) -> Result<()>
Source§impl InstrumentsSnapshotReader for DatabaseHandler
impl InstrumentsSnapshotReader for DatabaseHandler
Source§impl InstrumentsSnapshotWriter for DatabaseHandler
impl InstrumentsSnapshotWriter for DatabaseHandler
Source§fn write_instruments_snapshot_sync(
&self,
input: &InstrumentsSnapshotInput,
) -> Result<i64>
fn write_instruments_snapshot_sync( &self, input: &InstrumentsSnapshotInput, ) -> Result<i64>
Source§impl JournalReplayReader for DatabaseHandler
impl JournalReplayReader for DatabaseHandler
Source§fn get_next_engine_command_id_sync(&self) -> Result<i64>
fn get_next_engine_command_id_sync(&self) -> Result<i64>
Source§fn get_journal_command_id_bounds_sync(
&self,
) -> Result<Option<JournalCommandIdBounds>>
fn get_journal_command_id_bounds_sync( &self, ) -> Result<Option<JournalCommandIdBounds>>
engine_commands.Source§fn count_non_replayable_commands_in_range_sync(
&self,
start_command_id: i64,
end_command_id: i64,
) -> Result<i64>
fn count_non_replayable_commands_in_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<i64>
Source§fn get_commands_with_l2_after_seq_sync(
&self,
l2_seq: i64,
) -> Result<Vec<ReplayCommand>>
fn get_commands_with_l2_after_seq_sync( &self, l2_seq: i64, ) -> Result<Vec<ReplayCommand>>
Source§fn get_replay_commands_after_command_id_sync(
&self,
after_command_id: i64,
up_to_command_id: Option<i64>,
limit: i64,
) -> Result<Vec<ReplayCommand>>
fn get_replay_commands_after_command_id_sync( &self, after_command_id: i64, up_to_command_id: Option<i64>, limit: i64, ) -> Result<Vec<ReplayCommand>>
limit commands after after_command_id,
optionally bounded by up_to_command_id.Source§fn get_fill_events_for_command_range_sync(
&self,
start_command_id: i64,
end_command_id: i64,
) -> Result<Vec<Vec<u8>>>
fn get_fill_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<Vec<u8>>>
Source§fn get_portfolio_events_for_command_range_sync(
&self,
start_command_id: i64,
end_command_id: i64,
) -> Result<Vec<PortfolioReplayEvent>>
fn get_portfolio_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<PortfolioReplayEvent>>
Source§fn get_order_update_events_for_command_range_sync(
&self,
start_command_id: i64,
end_command_id: i64,
) -> Result<Vec<Vec<u8>>>
fn get_order_update_events_for_command_range_sync( &self, start_command_id: i64, end_command_id: i64, ) -> Result<Vec<Vec<u8>>>
Source§fn get_max_l2_seq_from_events_sync(&self) -> Result<i64>
fn get_max_l2_seq_from_events_sync(&self) -> Result<i64>
Source§impl MmpConfigReader for DatabaseHandler
impl MmpConfigReader for DatabaseHandler
Source§fn get_mmp_config_sync(
&self,
wallet: &WalletAddress,
currency: &str,
) -> Result<Option<MmpConfigRecord>>
fn get_mmp_config_sync( &self, wallet: &WalletAddress, currency: &str, ) -> Result<Option<MmpConfigRecord>>
Source§fn get_all_mmp_configs_for_wallet_sync(
&self,
wallet: &WalletAddress,
) -> Result<Vec<MmpConfigRecord>>
fn get_all_mmp_configs_for_wallet_sync( &self, wallet: &WalletAddress, ) -> Result<Vec<MmpConfigRecord>>
Source§fn get_all_mmp_configs_sync(&self) -> Result<Vec<MmpConfigRecord>>
fn get_all_mmp_configs_sync(&self) -> Result<Vec<MmpConfigRecord>>
Source§impl MmpConfigWriter for DatabaseHandler
impl MmpConfigWriter for DatabaseHandler
Source§impl OracleWriter for DatabaseHandler
impl OracleWriter for DatabaseHandler
Source§fn save_oracle_price_samples_sync(
&self,
samples: &[NewOraclePriceSampleInput],
) -> Result<()>
fn save_oracle_price_samples_sync( &self, samples: &[NewOraclePriceSampleInput], ) -> Result<()>
Source§fn save_oracle_settlement_price_sync(
&self,
settlement: &NewOracleSettlementPriceInput,
) -> Result<()>
fn save_oracle_settlement_price_sync( &self, settlement: &NewOracleSettlementPriceInput, ) -> Result<()>
Source§impl OrderReader for DatabaseHandler
impl OrderReader for DatabaseHandler
Source§fn get_order_infos_sync(
&self,
wallet: Option<&WalletAddress>,
) -> Result<Vec<OrderInfoRecord>>
fn get_order_infos_sync( &self, wallet: Option<&WalletAddress>, ) -> Result<Vec<OrderInfoRecord>>
Source§fn get_client_ids_by_order_ids_sync(
&self,
order_ids: &[i64],
) -> Result<HashMap<i64, Option<String>>>
fn get_client_ids_by_order_ids_sync( &self, order_ids: &[i64], ) -> Result<HashMap<i64, Option<String>>>
Source§fn get_terminal_order_ids_sync(&self, order_ids: &[i64]) -> Result<Vec<i64>>
fn get_terminal_order_ids_sync(&self, order_ids: &[i64]) -> Result<Vec<i64>>
Source§fn get_max_order_id_sync(&self) -> Result<u64>
fn get_max_order_id_sync(&self) -> Result<u64>
Source§fn get_max_trade_id_sync(&self) -> Result<u64>
fn get_max_trade_id_sync(&self) -> Result<u64>
Source§impl OrderWriter for DatabaseHandler
impl OrderWriter for DatabaseHandler
Source§fn persist_order_info_sync(&self, info: &PersistOrderInfo) -> Result<()>
fn persist_order_info_sync(&self, info: &PersistOrderInfo) -> Result<()>
Source§fn persist_order_action_sync(&self, action: &PersistOrderAction) -> Result<()>
fn persist_order_action_sync(&self, action: &PersistOrderAction) -> Result<()>
Source§fn persist_order_update_sync(&self, update: &OrderUpdateMessage) -> Result<()>
fn persist_order_update_sync(&self, update: &OrderUpdateMessage) -> Result<()>
Source§fn persist_fill_with_side_effects_sync(
&self,
fill: &Fill,
side_effects: &FillSideEffects,
) -> Result<(bool, bool)>
fn persist_fill_with_side_effects_sync( &self, fill: &Fill, side_effects: &FillSideEffects, ) -> Result<(bool, bool)>
Source§impl PmSettlementProjectionSyncReader for DatabaseHandler
impl PmSettlementProjectionSyncReader for DatabaseHandler
fn list_pm_settlement_pools_sync( &self, ) -> Result<Vec<PmSettlementPoolProjection>>
fn list_pm_settlement_accounts_sync( &self, ) -> Result<Vec<PmSettlementAccountProjection>>
fn list_pm_settlement_events_sync( &self, ) -> Result<Vec<PmSettlementEventProjection>>
fn list_pm_settlement_interest_events_sync( &self, ) -> Result<Vec<PmSettlementInterestEventProjection>>
fn list_pm_settlement_repayment_events_sync( &self, ) -> Result<Vec<PmSettlementRepaymentEventProjection>>
fn list_pm_recovery_plans_sync(&self) -> Result<Vec<PmRecoveryPlanProjection>>
fn list_pm_recovery_actions_sync( &self, ) -> Result<Vec<PmRecoveryActionProjection>>
Source§impl PmSettlementProjectionSyncWriter for DatabaseHandler
impl PmSettlementProjectionSyncWriter for DatabaseHandler
fn apply_pm_settlement_projection_writes_sync( &self, writes: &[PmSettlementProjectionWrite], ) -> Result<()>
Source§impl PortfolioSnapshotReader for DatabaseHandler
impl PortfolioSnapshotReader for DatabaseHandler
Source§fn get_latest_portfolio_snapshot_id_sync(&self) -> Result<Option<i64>>
fn get_latest_portfolio_snapshot_id_sync(&self) -> Result<Option<i64>>
Source§fn portfolio_snapshot_exists_sync(&self, snapshot_id: i64) -> Result<bool>
fn portfolio_snapshot_exists_sync(&self, snapshot_id: i64) -> Result<bool>
Source§fn load_portfolio_snapshot_sync(
&self,
snapshot_id: i64,
) -> Result<PortfolioSnapshotData>
fn load_portfolio_snapshot_sync( &self, snapshot_id: i64, ) -> Result<PortfolioSnapshotData>
Source§impl PortfolioSnapshotWriter for DatabaseHandler
impl PortfolioSnapshotWriter for DatabaseHandler
Source§fn write_portfolio_snapshot_sync(
&self,
input: &PortfolioSnapshotInput,
) -> Result<i64>
fn write_portfolio_snapshot_sync( &self, input: &PortfolioSnapshotInput, ) -> Result<i64>
Source§impl RfqReader for DatabaseHandler
impl RfqReader for DatabaseHandler
Source§fn get_all_quote_providers_sync(&self) -> Result<Vec<QuoteProviderRecord>>
fn get_all_quote_providers_sync(&self) -> Result<Vec<QuoteProviderRecord>>
Source§impl RfqWriter for DatabaseHandler
impl RfqWriter for DatabaseHandler
Source§fn upsert_quote_provider_sync(&self, qp: &QuoteProviderRecord) -> Result<()>
fn upsert_quote_provider_sync(&self, qp: &QuoteProviderRecord) -> Result<()>
Source§fn update_quote_provider_status_sync(
&self,
wallet: &WalletAddress,
status: &str,
) -> Result<()>
fn update_quote_provider_status_sync( &self, wallet: &WalletAddress, status: &str, ) -> Result<()>
Source§fn persist_rfq_record_sync(
&self,
rfq_id: &Uuid,
taker_wallet: &WalletAddress,
underlying: &str,
status: &str,
taker_signature: &str,
taker_nonce: u64,
legs_hash: &[u8; 32],
legs: &[(String, String, Decimal)],
expires_at_ms: u64,
) -> Result<()>
fn persist_rfq_record_sync( &self, rfq_id: &Uuid, taker_wallet: &WalletAddress, underlying: &str, status: &str, taker_signature: &str, taker_nonce: u64, legs_hash: &[u8; 32], legs: &[(String, String, Decimal)], expires_at_ms: u64, ) -> Result<()>
Source§fn persist_rfq_quote_sync(
&self,
quote_id: &Uuid,
rfq_id: &Uuid,
qp_wallet: &WalletAddress,
net_premium: Decimal,
valid_for_ms: u64,
qp_signature: &str,
qp_nonce: u64,
legs: &[(String, String, Decimal, Decimal)],
expires_at_ms: u64,
) -> Result<()>
fn persist_rfq_quote_sync( &self, quote_id: &Uuid, rfq_id: &Uuid, qp_wallet: &WalletAddress, net_premium: Decimal, valid_for_ms: u64, qp_signature: &str, qp_nonce: u64, legs: &[(String, String, Decimal, Decimal)], expires_at_ms: u64, ) -> Result<()>
Source§impl RsmCreditReader for DatabaseHandler
impl RsmCreditReader for DatabaseHandler
Source§fn directive_outbox_exists_sync(&self, directive_id: &str) -> Result<bool>
fn directive_outbox_exists_sync(&self, directive_id: &str) -> Result<bool>
Source§fn get_max_rsm_deposit_credit_observed_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_max_rsm_deposit_credit_observed_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_exchange_cash_ledger_watermark_sync(&self) -> Result<Option<i64>>
fn get_exchange_cash_ledger_watermark_sync(&self) -> Result<Option<i64>>
Source§fn get_option_instrument_for_credit<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<OptionInstrumentForCredit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_option_instrument_for_credit<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<Option<OptionInstrumentForCredit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn list_recent_cash_deposit_monitoring_rows<'life0, 'async_trait>(
&'life0 self,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<DepositMonitoringRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_recent_cash_deposit_monitoring_rows<'life0, 'async_trait>(
&'life0 self,
limit: i64,
offset: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<DepositMonitoringRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl RsmCreditWriter for DatabaseHandler
impl RsmCreditWriter for DatabaseHandler
Source§fn ensure_observed_deposit_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ensure_observed_deposit_account<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 WalletAddress,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn claim_rsm_deposit_credit<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 RsmDepositCreditClaimInput,
) -> Pin<Box<dyn Future<Output = Result<RsmDepositCreditClaimRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn claim_rsm_deposit_credit<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 RsmDepositCreditClaimInput,
) -> Pin<Box<dyn Future<Output = Result<RsmDepositCreditClaimRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn mark_rsm_deposit_credit_submitted<'life0, 'life1, 'async_trait>(
&'life0 self,
request_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_rsm_deposit_credit_submitted<'life0, 'life1, 'async_trait>(
&'life0 self,
request_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn mark_rsm_deposit_credit_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request_id: &'life1 str,
error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mark_rsm_deposit_credit_failed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request_id: &'life1 str,
error: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn pending_rsm_usdc_deposit_for_amount<'life0, 'life1, 'async_trait>(
&'life0 self,
amount_wei: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pending_rsm_usdc_deposit_for_amount<'life0, 'life1, 'async_trait>(
&'life0 self,
amount_wei: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn pending_rsm_usdc_deposit_for_evm_tx_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
evm_tx_hash: &'life1 str,
amount_wei: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pending_rsm_usdc_deposit_for_evm_tx_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
evm_tx_hash: &'life1 str,
amount_wei: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn pending_rsm_usdc_deposit_for_credited_hypercore_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
amount_wei: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pending_rsm_usdc_deposit_for_credited_hypercore_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
amount_wei: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RsmUsdcDepositMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn credited_wallet_for_hypercore_cash_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<WalletAddress>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn credited_wallet_for_hypercore_cash_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<WalletAddress>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn non_crediting_hypercore_cash_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
amount_usdc: Decimal,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn non_crediting_hypercore_cash_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_hash: &'life1 str,
amount_usdc: Decimal,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn apply_hypercore_cash_deposit<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 HypercoreCashLedgerApply,
) -> Pin<Box<dyn Future<Output = Result<HypercoreCashLedgerApplyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_hypercore_cash_deposit<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 HypercoreCashLedgerApply,
) -> Pin<Box<dyn Future<Output = Result<HypercoreCashLedgerApplyResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn record_hypercore_cash_deposit_pending_margin_mode<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 HypercoreCashLedgerApply,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_hypercore_cash_deposit_pending_margin_mode<'life0, 'life1, 'async_trait>(
&'life0 self,
input: &'life1 HypercoreCashLedgerApply,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl SettlementReader for DatabaseHandler
impl SettlementReader for DatabaseHandler
Source§fn is_settlement_ledger_applied_sync(
&self,
wallet: &WalletAddress,
symbol: &str,
) -> Result<bool>
fn is_settlement_ledger_applied_sync( &self, wallet: &WalletAddress, symbol: &str, ) -> Result<bool>
Source§fn get_applied_settlement_symbols_sync(
&self,
wallet: &WalletAddress,
symbols: &[String],
) -> Result<HashSet<String>>
fn get_applied_settlement_symbols_sync( &self, wallet: &WalletAddress, symbols: &[String], ) -> Result<HashSet<String>>
Source§fn get_total_fill_volume_sync(&self) -> Result<(i64, Decimal)>
fn get_total_fill_volume_sync(&self) -> Result<(i64, Decimal)>
Source§impl SettlementWriter for DatabaseHandler
impl SettlementWriter for DatabaseHandler
Source§fn try_apply_settlement_sync(
&self,
wallet: &WalletAddress,
symbol: &str,
position_size: Decimal,
settlement_price: Decimal,
settlement_value: Decimal,
margin_mode: MarginMode,
event_ts_ms: i64,
settlement_entry_price: Option<Decimal>,
cost_basis: Option<Decimal>,
net_pnl: Option<Decimal>,
) -> Result<SettlementResult>
fn try_apply_settlement_sync( &self, wallet: &WalletAddress, symbol: &str, position_size: Decimal, settlement_price: Decimal, settlement_value: Decimal, margin_mode: MarginMode, event_ts_ms: i64, settlement_entry_price: Option<Decimal>, cost_basis: Option<Decimal>, net_pnl: Option<Decimal>, ) -> Result<SettlementResult>
Source§fn observe_applied_settlement_sync(
&self,
wallet: &WalletAddress,
symbol: &str,
position_size: Decimal,
settlement_price: Decimal,
settlement_value: Decimal,
margin_mode: MarginMode,
settlement_entry_price: Option<Decimal>,
cost_basis: Option<Decimal>,
net_pnl: Option<Decimal>,
) -> Result<SettlementResult>
fn observe_applied_settlement_sync( &self, wallet: &WalletAddress, symbol: &str, position_size: Decimal, settlement_price: Decimal, settlement_value: Decimal, margin_mode: MarginMode, settlement_entry_price: Option<Decimal>, cost_basis: Option<Decimal>, net_pnl: Option<Decimal>, ) -> Result<SettlementResult>
Source§impl TierReader for DatabaseHandler
impl TierReader for DatabaseHandler
Source§fn get_margin_mode_sync(&self, wallet: &WalletAddress) -> Result<MarginMode>
fn get_margin_mode_sync(&self, wallet: &WalletAddress) -> Result<MarginMode>
Source§fn get_existing_margin_mode_sync(
&self,
wallet: &WalletAddress,
) -> Result<Option<MarginMode>>
fn get_existing_margin_mode_sync( &self, wallet: &WalletAddress, ) -> Result<Option<MarginMode>>
Source§fn get_tier_defaults_sync(
&self,
tier_name: &str,
) -> Result<Option<TierDefaultsRecord>>
fn get_tier_defaults_sync( &self, tier_name: &str, ) -> Result<Option<TierDefaultsRecord>>
Source§fn get_user_tier_sync(
&self,
wallet: &WalletAddress,
) -> Result<Option<UserTierRecord>>
fn get_user_tier_sync( &self, wallet: &WalletAddress, ) -> Result<Option<UserTierRecord>>
Source§fn get_all_user_tiers_sync(&self) -> Result<Vec<UserTierRecord>>
fn get_all_user_tiers_sync(&self) -> Result<Vec<UserTierRecord>>
Source§impl TierWriter for DatabaseHandler
impl TierWriter for DatabaseHandler
Source§fn save_user_tier_sync(&self, update: &UserTierUpdate) -> Result<()>
fn save_user_tier_sync(&self, update: &UserTierUpdate) -> Result<()>
Source§fn set_margin_mode_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<i64>
fn set_margin_mode_sync( &self, wallet: &WalletAddress, margin_mode: MarginMode, ) -> Result<i64>
Source§fn insert_margin_mode_if_missing_sync(
&self,
wallet: &WalletAddress,
margin_mode: MarginMode,
) -> Result<Option<i64>>
fn insert_margin_mode_if_missing_sync( &self, wallet: &WalletAddress, margin_mode: MarginMode, ) -> Result<Option<i64>>
Source§fn delete_user_tier_sync(&self, wallet: &WalletAddress) -> Result<()>
fn delete_user_tier_sync(&self, wallet: &WalletAddress) -> Result<()>
Source§impl TransactionSubmitterStore for DatabaseHandler
impl TransactionSubmitterStore for DatabaseHandler
fn max_nonce_for_submitter_sync( &self, submitter: &SubmitterId, ) -> Result<Option<u64>>
fn record_submission_sync( &self, record: &SubmissionRecord, attempts: &[SubmissionAttemptRecord], ) -> Result<()>
fn update_submission_status_sync( &self, submitter: &SubmitterId, nonce: SubmittedNonce, status: SubmissionStatus, primary_tx_hash: Option<&str>, terminal_error: Option<&str>, ) -> Result<()>
fn list_pending_submissions_sync( &self, after_submission_id: i64, limit: i64, ) -> Result<Vec<PendingSubmissionRow>>
Source§impl Transactional for DatabaseHandler
impl Transactional for DatabaseHandler
type Tx = DieselTransaction
fn begin_transaction(&self) -> Result<DieselTransaction>
Source§impl ValidatorRsmStateReader for DatabaseHandler
impl ValidatorRsmStateReader for DatabaseHandler
fn get_validator_rsm_root_summary_sync( &self, environment: ValidatorRsmEnvironment, version: u64, ) -> Result<Option<ValidatorRsmRootSummary>>
fn get_validator_rsm_current_state_sync( &self, environment: ValidatorRsmEnvironment, ) -> Result<Option<ValidatorRsmCurrentState>>
fn get_validator_rsm_current_root_summary_sync( &self, environment: ValidatorRsmEnvironment, ) -> Result<Option<ValidatorRsmRootSummary>>
fn get_rsm_block_by_height_sync( &self, environment: ValidatorRsmEnvironment, height: u64, ) -> Result<Option<RsmBlockView>>
fn get_rsm_block_by_hash_sync( &self, environment: ValidatorRsmEnvironment, hash: [u8; 32], ) -> Result<Option<RsmBlockView>>
fn get_latest_rsm_block_sync( &self, environment: ValidatorRsmEnvironment, ) -> Result<Option<RsmBlockView>>
fn list_rsm_blocks_sync( &self, environment: ValidatorRsmEnvironment, from_height: Option<u64>, limit: u32, ) -> Result<Vec<RsmBlockView>>
fn get_rsm_block_commands_sync( &self, environment: ValidatorRsmEnvironment, height: u64, ) -> Result<Vec<RsmBlockCommand>>
fn get_rsm_block_data_sync( &self, environment: ValidatorRsmEnvironment, height: u64, ) -> Result<Option<RsmBlockData>, Error>
Source§impl ValidatorRsmStateWriter for DatabaseHandler
impl ValidatorRsmStateWriter for DatabaseHandler
fn save_validator_rsm_root_summary_sync( &self, summary: &NewValidatorRsmRootSummary, advance_current: bool, ) -> Result<()>
fn save_rsm_block_header_sync(&self, block: &NewRsmBlockHeader) -> Result<()>
fn save_rsm_block_commands_sync( &self, commands: &[NewRsmBlockCommand], ) -> Result<()>
Auto Trait Implementations§
impl Freeze for DatabaseHandler
impl !RefUnwindSafe for DatabaseHandler
impl Send for DatabaseHandler
impl Sync for DatabaseHandler
impl Unpin for DatabaseHandler
impl UnsafeUnpin for DatabaseHandler
impl !UnwindSafe for DatabaseHandler
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync 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,
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,
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,
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,
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,
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,
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,
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,
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,
§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>
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>
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> IntoSql for T
impl<T> IntoSql for T
§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,
§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,
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,
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
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
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
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>where
Conn: AsyncConnectionCore + Send,
Self: ExecuteDsl<Conn> + 'query,
fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>where
Conn: AsyncConnectionCore + Send,
Self: ExecuteDsl<Conn> + 'query,
§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Stream] with the returned rows. Read more§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>where
U: Send + 'conn,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>where
U: Send + 'conn,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>where
U: Send,
Conn: AsyncConnectionCore,
Self: LoadQuery<'query, Conn, U> + 'query,
Vec with the affected rows. Read more§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
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
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
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
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
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
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
.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
.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
.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
.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
.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
.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
.tap_deref() only in debug builds, and is erased in release
builds.