pub trait GatewayDbtxNcExt {
Show 16 methods
// Required methods
async fn save_federation_config(&mut self, config: &FederationConfig);
async fn load_federation_configs_v0(
&mut self,
) -> BTreeMap<FederationId, FederationConfigV0>;
async fn load_federation_configs(
&mut self,
) -> BTreeMap<FederationId, FederationConfig>;
async fn load_federation_config(
&mut self,
federation_id: FederationId,
) -> Option<FederationConfig>;
async fn remove_federation_config(&mut self, federation_id: FederationId);
async fn load_or_create_gateway_keypair(
&mut self,
protocol: RegisteredProtocol,
) -> Keypair;
async fn save_new_preimage_authentication(
&mut self,
payment_hash: Hash,
preimage_auth: Hash,
);
async fn load_preimage_authentication(
&mut self,
payment_hash: Hash,
) -> Option<Hash>;
async fn save_registered_incoming_contract(
&mut self,
federation_id: FederationId,
incoming_amount: Amount,
contract: IncomingContract,
) -> Option<RegisteredIncomingContract>;
async fn load_registered_incoming_contract(
&mut self,
payment_image: PaymentImage,
) -> Option<RegisteredIncomingContract>;
async fn claim_outgoing_payment_image(
&mut self,
payment_image: PaymentImage,
operation_id: OperationId,
) -> OperationId;
async fn dump_database(
&mut self,
prefix_names: Vec<String>,
) -> BTreeMap<String, Box<dyn Serialize + Send>>;
async fn load_or_create_iroh_key(&mut self) -> SecretKey;
async fn load_backup_records(
&mut self,
) -> BTreeMap<FederationId, Option<SystemTime>>;
async fn load_backup_record(
&mut self,
federation_id: FederationId,
) -> Option<Option<SystemTime>>;
async fn save_federation_backup_record(
&mut self,
federation_id: FederationId,
backup_time: Option<SystemTime>,
);
}Required Methods§
async fn save_federation_config(&mut self, config: &FederationConfig)
async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>
async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>
async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>
async fn remove_federation_config(&mut self, federation_id: FederationId)
Sourceasync fn load_or_create_gateway_keypair(
&mut self,
protocol: RegisteredProtocol,
) -> Keypair
async fn load_or_create_gateway_keypair( &mut self, protocol: RegisteredProtocol, ) -> Keypair
Returns the keypair that uniquely identifies the gateway, creating it if it does not exist. Remember to commit the transaction after calling this method.
async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, )
async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>
Sourceasync fn save_registered_incoming_contract(
&mut self,
federation_id: FederationId,
incoming_amount: Amount,
contract: IncomingContract,
) -> Option<RegisteredIncomingContract>
async fn save_registered_incoming_contract( &mut self, federation_id: FederationId, incoming_amount: Amount, contract: IncomingContract, ) -> Option<RegisteredIncomingContract>
Saves a registered incoming contract, returning the previous contract with the same payment hash if it existed.
async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>
Sourceasync fn claim_outgoing_payment_image(
&mut self,
payment_image: PaymentImage,
operation_id: OperationId,
) -> OperationId
async fn claim_outgoing_payment_image( &mut self, payment_image: PaymentImage, operation_id: OperationId, ) -> OperationId
Records operation_id as the claimer of payment_image, unless another
operation already claimed it, and returns the operation id that holds
the claim. Lets the gateway claim at most one outgoing contract per
payment image across all federations while tolerating retries of the
same operation.
Sourceasync fn dump_database(
&mut self,
prefix_names: Vec<String>,
) -> BTreeMap<String, Box<dyn Serialize + Send>>
async fn dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>
Reads and serializes structures from the gateway’s database for the purpose for serializing to JSON for inspection.
Sourceasync fn load_or_create_iroh_key(&mut self) -> SecretKey
async fn load_or_create_iroh_key(&mut self) -> SecretKey
Returns iroh::SecretKey and saves it to the database if it does not
exist
Sourceasync fn load_backup_records(
&mut self,
) -> BTreeMap<FederationId, Option<SystemTime>>
async fn load_backup_records( &mut self, ) -> BTreeMap<FederationId, Option<SystemTime>>
Returns a BTreeMap that maps FederationId to its last backup time
Sourceasync fn load_backup_record(
&mut self,
federation_id: FederationId,
) -> Option<Option<SystemTime>>
async fn load_backup_record( &mut self, federation_id: FederationId, ) -> Option<Option<SystemTime>>
Returns the last backup time for a federation
Sourceasync fn save_federation_backup_record(
&mut self,
federation_id: FederationId,
backup_time: Option<SystemTime>,
)
async fn save_federation_backup_record( &mut self, federation_id: FederationId, backup_time: Option<SystemTime>, )
Saves the last backup time of a federation
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.