ln_gateway::db

Trait GatewayDbtxNcExt

Source
pub trait GatewayDbtxNcExt {
Show 15 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_gateway_keypair(&mut self) -> Option<Keypair>; async fn load_gateway_keypair_assert_exists(&mut self) -> Keypair; async fn load_or_create_gateway_keypair(&mut self) -> Keypair; async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>; async fn set_gateway_config( &mut self, gateway_config: &GatewayConfiguration, ); 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 dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>;
}

Required Methods§

Source

async fn save_federation_config(&mut self, config: &FederationConfig)

Source

async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>

Source

async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>

Source

async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>

Source

async fn remove_federation_config(&mut self, federation_id: FederationId)

Source

async fn load_gateway_keypair(&mut self) -> Option<Keypair>

Returns the keypair that uniquely identifies the gateway.

Source

async fn load_gateway_keypair_assert_exists(&mut self) -> Keypair

Returns the keypair that uniquely identifies the gateway.

§Panics

Gateway keypair does not exist.

Source

async fn load_or_create_gateway_keypair(&mut self) -> 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.

Source

async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>

Source

async fn set_gateway_config(&mut self, gateway_config: &GatewayConfiguration)

Source

async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, )

Source

async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>

Source

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.

Source

async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>

Source

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.

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.

Implementations on Foreign Types§

Source§

impl<Cap: Send> GatewayDbtxNcExt for DatabaseTransaction<'_, Cap>

Source§

async fn save_federation_config(&mut self, config: &FederationConfig)

Source§

async fn load_federation_configs_v0( &mut self, ) -> BTreeMap<FederationId, FederationConfigV0>

Source§

async fn load_federation_configs( &mut self, ) -> BTreeMap<FederationId, FederationConfig>

Source§

async fn load_federation_config( &mut self, federation_id: FederationId, ) -> Option<FederationConfig>

Source§

async fn remove_federation_config(&mut self, federation_id: FederationId)

Source§

async fn load_gateway_keypair(&mut self) -> Option<Keypair>

Source§

async fn load_gateway_keypair_assert_exists(&mut self) -> Keypair

Source§

async fn load_or_create_gateway_keypair(&mut self) -> Keypair

Source§

async fn load_gateway_config(&mut self) -> Option<GatewayConfiguration>

Source§

async fn set_gateway_config(&mut self, gateway_config: &GatewayConfiguration)

Source§

async fn save_new_preimage_authentication( &mut self, payment_hash: Hash, preimage_auth: Hash, )

Source§

async fn load_preimage_authentication( &mut self, payment_hash: Hash, ) -> Option<Hash>

Source§

async fn save_registered_incoming_contract( &mut self, federation_id: FederationId, incoming_amount: Amount, contract: IncomingContract, ) -> Option<RegisteredIncomingContract>

Source§

async fn load_registered_incoming_contract( &mut self, payment_image: PaymentImage, ) -> Option<RegisteredIncomingContract>

Source§

async fn dump_database( &mut self, prefix_names: Vec<String>, ) -> BTreeMap<String, Box<dyn Serialize + Send>>

Implementors§