Skip to main content

Migration

Trait Migration 

Source
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§

Source

fn from_version(&self) -> (u64, u64, u64)

The version this migration migrates FROM.

Source

fn to_version(&self) -> (u64, u64, u64)

The version this migration migrates TO.

Source

fn description(&self) -> &str

Human-readable description of what this migration does.

Source

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".

Implementors§