Trait fedimint_client::module::IClientModule

source ·
pub trait IClientModule: Debug {
Show 14 methods // Required methods fn as_any(&self) -> &(dyn Any + Send + Sync); fn decoder(&self) -> Decoder; fn context(&self, instance: ModuleInstanceId) -> DynContext; 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 input_amount(&self, input: &DynInput) -> Option<TransactionItemAmount>; fn output_amount(&self, output: &DynOutput) -> Option<TransactionItemAmount>; 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_sufficient_input<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, min_amount: Amount ) -> Pin<Box<dyn Future<Output = Result<Vec<ClientInput>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn create_exact_output<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, amount: Amount ) -> Pin<Box<dyn Future<Output = 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 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 input_amount(&self, input: &DynInput) -> Option<TransactionItemAmount>

source

fn output_amount(&self, output: &DynOutput) -> Option<TransactionItemAmount>

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_sufficient_input<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, min_amount: Amount ) -> Pin<Box<dyn Future<Output = Result<Vec<ClientInput>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn create_exact_output<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, module_instance: ModuleInstanceId, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, amount: Amount ) -> Pin<Box<dyn Future<Output = 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,