fedimint_client::module::init

Trait IClientModuleInit

Source
pub trait IClientModuleInit:
    IDynCommonModuleInit
    + Debug
    + MaybeSend
    + MaybeSync {
    // Required methods
    fn decoder(&self) -> Decoder;
    fn module_kind(&self) -> ModuleKind;
    fn as_common(&self) -> &(dyn IDynCommonModuleInit + Send + Sync + 'static);
    fn supported_api_versions(&self) -> MultiApiVersion;
    fn recover<'life0, 'life1, 'async_trait>(
        &'life0 self,
        final_client: FinalClient,
        federation_id: FederationId,
        num_peers: NumPeers,
        cfg: ClientModuleConfig,
        db: Database,
        instance_id: ModuleInstanceId,
        core_api_version: ApiVersion,
        module_api_version: ApiVersion,
        module_root_secret: DerivableSecret,
        notifier: Notifier,
        api: DynGlobalApi,
        admin_auth: Option<ApiAuth>,
        snapshot: Option<&'life1 DynModuleBackup>,
        progress_tx: Sender<RecoveryProgress>,
        task_group: TaskGroup,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn init<'life0, 'async_trait>(
        &'life0 self,
        final_client: FinalClient,
        federation_id: FederationId,
        peer_num: usize,
        cfg: ClientModuleConfig,
        db: Database,
        instance_id: ModuleInstanceId,
        core_api_version: ApiVersion,
        module_api_version: ApiVersion,
        module_root_secret: DerivableSecret,
        notifier: Notifier,
        api: DynGlobalApi,
        admin_auth: Option<ApiAuth>,
        task_group: TaskGroup,
    ) -> Pin<Box<dyn Future<Output = Result<DynClientModule>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_database_migrations(
        &self,
    ) -> BTreeMap<DatabaseVersion, ClientMigrationFn>;
}

Required Methods§

Source

fn decoder(&self) -> Decoder

Source

fn module_kind(&self) -> ModuleKind

Source

fn as_common(&self) -> &(dyn IDynCommonModuleInit + Send + Sync + 'static)

Source

fn supported_api_versions(&self) -> MultiApiVersion

Source

fn recover<'life0, 'life1, 'async_trait>( &'life0 self, final_client: FinalClient, federation_id: FederationId, num_peers: NumPeers, cfg: ClientModuleConfig, db: Database, instance_id: ModuleInstanceId, core_api_version: ApiVersion, module_api_version: ApiVersion, module_root_secret: DerivableSecret, notifier: Notifier, api: DynGlobalApi, admin_auth: Option<ApiAuth>, snapshot: Option<&'life1 DynModuleBackup>, progress_tx: Sender<RecoveryProgress>, task_group: TaskGroup, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn init<'life0, 'async_trait>( &'life0 self, final_client: FinalClient, federation_id: FederationId, peer_num: usize, cfg: ClientModuleConfig, db: Database, instance_id: ModuleInstanceId, core_api_version: ApiVersion, module_api_version: ApiVersion, module_root_secret: DerivableSecret, notifier: Notifier, api: DynGlobalApi, admin_auth: Option<ApiAuth>, task_group: TaskGroup, ) -> Pin<Box<dyn Future<Output = Result<DynClientModule>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_database_migrations( &self, ) -> BTreeMap<DatabaseVersion, ClientMigrationFn>

Trait Implementations§

Source§

impl AsRef<dyn IClientModuleInit> for DynClientModuleInit

Source§

fn as_ref(&self) -> &(dyn IClientModuleInit + 'static)

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

Implementors§

Source§

impl<T> IClientModuleInit for T
where T: ClientModuleInit + 'static + MaybeSend + Sync,