fedimint_core::module

Trait IDynCommonModuleInit

Source
pub trait IDynCommonModuleInit: Debug {
    // Required methods
    fn decoder(&self) -> Decoder;
    fn module_kind(&self) -> ModuleKind;
    fn to_dyn_common(&self) -> DynCommonModuleInit;
    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 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§