pub trait Migration: Send + Sync {
// Required methods
fn from_version(&self) -> (u64, u64, u64);
fn to_version(&self) -> (u64, u64, u64);
fn description(&self) -> &str;
fn migrate(&self, ctx: &mut MigrationContext) -> ServerResult<()>;
}Expand description
A single version-to-version migration step.
Required Methods§
Sourcefn from_version(&self) -> (u64, u64, u64)
fn from_version(&self) -> (u64, u64, u64)
The version this migration migrates FROM.
Sourcefn to_version(&self) -> (u64, u64, u64)
fn to_version(&self) -> (u64, u64, u64)
The version this migration migrates TO.
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of what this migration does.
Sourcefn migrate(&self, ctx: &mut MigrationContext) -> ServerResult<()>
fn migrate(&self, ctx: &mut MigrationContext) -> ServerResult<()>
Apply the migration to a document context.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".