Skip to main content

LayoutMigration

Trait LayoutMigration 

Source
pub trait LayoutMigration {
    const MIGRATIONS: &'static [MigrationEdge];
}
Expand description

Layouts opt into in-place migration by providing a MIGRATIONS constant. The default (empty slice) means “no migrations declared” and any mismatch between header and AccountLayout::SCHEMA_EPOCH is a hard failure.

The trait is sealed-by-convention: downstream crates should express migrations via the #[hopper::migrate(...)] attribute macro and the hopper::layout_migrations! composition helper, never by hand-writing impl LayoutMigration for T.

Required Associated Constants§

Source

const MIGRATIONS: &'static [MigrationEdge]

Ordered migration chain. MIGRATIONS[i].to_epoch == MIGRATIONS[i + 1].from_epoch must hold for every adjacent pair, and the whole chain must be strictly monotonic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§