fedimint_client::module

Trait IClientModule

source
pub trait IClientModule: Debug {
Show 15 methods // Required methods fn as_any(&self) -> &(dyn Any + Send + Sync); fn decoder(&self) -> Decoder; fn context(&self, instance: ModuleInstanceId) -> DynContext; fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn handle_cli_command<'life0, 'life1, 'async_trait>( &'life0 self, args: &'life1 [OsString], ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn handle_rpc<'life0, 'async_trait>( &'life0 self, method: String, request: Value, ) -> Pin<Box<dyn Future<Output = BoxStream<'_, Result<Value>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn input_fee(&self, amount: Amount, input: &DynInput) -> Option<Amount>; fn output_fee(&self, output: &DynOutput) -> Option<Amount>; fn supports_backup(&self) -> bool; fn backup<'life0, 'async_trait>( &'life0 self, module_instance_id: ModuleInstanceId, ) -> Pin<Box<dyn Future<Output = Result<DynModuleBackup>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn supports_being_primary(&self) -> bool; fn create_final_inputs_and_outputs<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, input_amount: Amount, output_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<(Vec<ClientInput>, Vec<ClientOutput>)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn await_primary_module_output<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, out_point: OutPoint, ) -> Pin<Box<dyn Future<Output = Result<Amount>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_balance<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn subscribe_balance_changes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BoxStream<'static, ()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Type-erased version of ClientModule

Required Methods§

source

fn as_any(&self) -> &(dyn Any + Send + Sync)

source

fn decoder(&self) -> Decoder

source

fn context(&self, instance: ModuleInstanceId) -> DynContext

source

fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn handle_cli_command<'life0, 'life1, 'async_trait>( &'life0 self, args: &'life1 [OsString], ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn handle_rpc<'life0, 'async_trait>( &'life0 self, method: String, request: Value, ) -> Pin<Box<dyn Future<Output = BoxStream<'_, Result<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn input_fee(&self, amount: Amount, input: &DynInput) -> Option<Amount>

source

fn output_fee(&self, output: &DynOutput) -> Option<Amount>

source

fn supports_backup(&self) -> bool

source

fn backup<'life0, 'async_trait>( &'life0 self, module_instance_id: ModuleInstanceId, ) -> Pin<Box<dyn Future<Output = Result<DynModuleBackup>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn supports_being_primary(&self) -> bool

source

fn create_final_inputs_and_outputs<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, input_amount: Amount, output_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<(Vec<ClientInput>, Vec<ClientOutput>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn await_primary_module_output<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, out_point: OutPoint, ) -> Pin<Box<dyn Future<Output = Result<Amount>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_balance<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, ) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn subscribe_balance_changes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BoxStream<'static, ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trait Implementations§

source§

impl AsRef<dyn IClientModule + Sync + Send> for DynClientModule

source§

fn as_ref(&self) -> &(dyn IClientModule + Send + Sync + 'static)

Converts this type into a shared reference of the (usually inferred) input type.

Implementors§

source§

impl<T> IClientModule for T
where T: ClientModule,