Trait fedimint_core::module::ModuleInit

source ·
pub trait ModuleInit: Debug + Clone + Send + Sync + 'static {
    type Common: CommonModuleInit;

    const DATABASE_VERSION: DatabaseVersion;

    // Required method
    fn dump_database(
        &self,
        dbtx: &mut DatabaseTransaction<'_>,
        prefix_names: Vec<String>,
    ) -> impl Future<Output = Box<dyn Iterator<Item = (String, Box<dyn Serialize + Send>)> + '_>> + Send;
}
Expand description

Trait implemented by every *ModuleInit (server or client side)

Required Associated Types§

Required Associated Constants§

source

const DATABASE_VERSION: DatabaseVersion

This represents the module’s database version that the current code is compatible with. It is important to increment this value whenever a key or a value that is persisted to the database within the module changes. It is also important to add the corresponding migration function in get_database_migrations which should define how to move from the previous database version to the current version.

Required Methods§

source

fn dump_database( &self, dbtx: &mut DatabaseTransaction<'_>, prefix_names: Vec<String>, ) -> impl Future<Output = Box<dyn Iterator<Item = (String, Box<dyn Serialize + Send>)> + '_>> + Send

Object Safety§

This trait is not object safe.

Implementors§