pub trait SessionMigrator: Send + Sync {
// Required methods
fn source_version(&self) -> u32;
fn target_version(&self) -> u32;
fn migrate(
&self,
meta: &SessionMeta,
entries: Vec<SessionEntry>,
) -> Result<Vec<SessionEntry>>;
}Expand description
Migrates session entries from one schema version to the next.
Implementations should transform entries from source_version() to
target_version(). The migration runner calls migrate
only when the session’s version matches source_version().
Required Methods§
Sourcefn source_version(&self) -> u32
fn source_version(&self) -> u32
The schema version this migrator reads.
Sourcefn target_version(&self) -> u32
fn target_version(&self) -> u32
The schema version this migrator produces.
Sourcefn migrate(
&self,
meta: &SessionMeta,
entries: Vec<SessionEntry>,
) -> Result<Vec<SessionEntry>>
fn migrate( &self, meta: &SessionMeta, entries: Vec<SessionEntry>, ) -> Result<Vec<SessionEntry>>
Transform session entries from source_version to target_version.
The implementation may modify, add, or remove entries. It must NOT
modify meta.version — the runner handles that.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".