Trait frame_support::migrations::SteppedMigrations
source · pub trait SteppedMigrations {
// Required methods
fn len() -> u32;
fn nth_id(n: u32) -> Option<Vec<u8>>;
fn nth_max_steps(n: u32) -> Option<Option<u32>>;
fn nth_step(
n: u32,
cursor: Option<Vec<u8>>,
meter: &mut WeightMeter
) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>;
fn nth_transactional_step(
n: u32,
cursor: Option<Vec<u8>>,
meter: &mut WeightMeter
) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>;
fn cursor_max_encoded_len() -> usize;
fn identifier_max_encoded_len() -> usize;
// Provided method
fn integrity_test() -> Result<(), &'static str> { ... }
}Expand description
Multiple SteppedMigration.
Required Methods§
sourcefn nth_id(n: u32) -> Option<Vec<u8>>
fn nth_id(n: u32) -> Option<Vec<u8>>
The nth SteppedMigration::id.
Is guaranteed to return Some if n < Self::len().
sourcefn nth_max_steps(n: u32) -> Option<Option<u32>>
fn nth_max_steps(n: u32) -> Option<Option<u32>>
The SteppedMigration::max_steps of the nth migration.
Is guaranteed to return Some if n < Self::len().
sourcefn nth_step(
n: u32,
cursor: Option<Vec<u8>>,
meter: &mut WeightMeter
) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>
fn nth_step( n: u32, cursor: Option<Vec<u8>>, meter: &mut WeightMeter ) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>
Do a SteppedMigration::step on the nth migration.
Is guaranteed to return Some if n < Self::len().
sourcefn nth_transactional_step(
n: u32,
cursor: Option<Vec<u8>>,
meter: &mut WeightMeter
) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>
fn nth_transactional_step( n: u32, cursor: Option<Vec<u8>>, meter: &mut WeightMeter ) -> Option<Result<Option<Vec<u8>>, SteppedMigrationError>>
Do a SteppedMigration::transactional_step on the nth migration.
Is guaranteed to return Some if n < Self::len().
sourcefn cursor_max_encoded_len() -> usize
fn cursor_max_encoded_len() -> usize
The maximal encoded length across all cursors.
sourcefn identifier_max_encoded_len() -> usize
fn identifier_max_encoded_len() -> usize
The maximal encoded length across all identifiers.
Provided Methods§
sourcefn integrity_test() -> Result<(), &'static str>
fn integrity_test() -> Result<(), &'static str>
Assert the integrity of the migrations.
Should be executed as part of a test prior to runtime usage. May or may not need externalities.
Object Safety§
This trait is not object safe.