Skip to main content

Module migrations

Module migrations 

Source
Expand description

Schema migration system for save data.

MigrationRegistry holds an ordered chain of MigrationFn values keyed by source version. migrate(data, from, to) runs the chain to bring save data from any older version up to the current version without data loss.

Structs§

MigrationRegistry
Holds an ordered chain of migrations keyed by source version.
SaveData
Flexible key→value store that migrations read and modify.
SchemaVersion
A monotonically increasing version number for the save schema.

Enums§

SaveValue
A flexible value type for use inside SaveData.

Type Aliases§

MigrationFn
A function that transforms SaveData from version N to N+1.