Trait fedimint_core::module::IDynCommonModuleInit

source ·
pub trait IDynCommonModuleInit: Debug {
    // Required methods
    fn decoder(&self) -> Decoder;
    fn module_kind(&self) -> ModuleKind;
    fn to_dyn_common(&self) -> DynCommonModuleInit;
    fn database_version(&self) -> DatabaseVersion;
    fn dump_database<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut DatabaseTransaction<'life2>,
        prefix_names: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = (String, Box<dyn Serialize + Send>)> + '_>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Operations common to Server and Client side module gen dyn newtypes

Due to conflict of impl Trait for T for both ServerModuleInit and ClientModuleInit, we can’t really have a ICommonModuleInit, so to unify them in ModuleInitRegistry we move the common functionality to be an interface over their dyn newtype wrappers. A bit weird, but works.

Required Methods§

source

fn decoder(&self) -> Decoder

source

fn module_kind(&self) -> ModuleKind

source

fn to_dyn_common(&self) -> DynCommonModuleInit

source

fn database_version(&self) -> DatabaseVersion

source

fn dump_database<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut DatabaseTransaction<'life2>, prefix_names: Vec<String>, ) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = (String, Box<dyn Serialize + Send>)> + '_>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Trait Implementations§

source§

impl AsRef<dyn IDynCommonModuleInit + Sync + Send> for DynCommonModuleInit

source§

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

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

impl AsRef<dyn IDynCommonModuleInit + Sync + Send> for DynServerModuleInit

source§

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

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

Implementors§