pub trait Planner: Send + Sync {
// Required methods
fn create_plan<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
current: &'life1 SchemaSnapshot,
target: &'life2 SchemaSnapshot,
diff: &'life3 SchemaDiff,
) -> Pin<Box<dyn Future<Output = Result<MigrationPlan>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn validate_plan<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 MigrationPlan,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for planning migrations
Different planners can implement different strategies:
- Safe ordering (create before references)
- Dependency resolution
- Conflict detection
- Optimization (batch operations)
Required Methods§
Sourcefn create_plan<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
current: &'life1 SchemaSnapshot,
target: &'life2 SchemaSnapshot,
diff: &'life3 SchemaDiff,
) -> Pin<Box<dyn Future<Output = Result<MigrationPlan>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_plan<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
current: &'life1 SchemaSnapshot,
target: &'life2 SchemaSnapshot,
diff: &'life3 SchemaDiff,
) -> Pin<Box<dyn Future<Output = Result<MigrationPlan>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn validate_plan<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 MigrationPlan,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_plan<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 MigrationPlan,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate a migration plan
Checks for:
- Circular dependencies
- Invalid operations
- Safety issues
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".