Skip to main content

Executor

Trait Executor 

Source
pub trait Executor: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tenant: &'life1 TenantContext,
        plan: &'life2 MigrationPlan,
        runner: &'life3 dyn MigrationRunner,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn dry_run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        tenant: &'life1 TenantContext,
        plan: &'life2 MigrationPlan,
        runner: &'life3 dyn MigrationRunner,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Trait for executing migration plans

The executor coordinates between the planner, migration runner, and other components to safely execute migrations.

Required Methods§

Source

fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tenant: &'life1 TenantContext, plan: &'life2 MigrationPlan, runner: &'life3 dyn MigrationRunner, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a migration plan for a tenant

§Arguments
  • tenant - The tenant context
  • plan - The migration plan to execute
  • runner - The migration runner to use
§Returns

Execution result with success status and details.

Source

fn dry_run<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, tenant: &'life1 TenantContext, plan: &'life2 MigrationPlan, runner: &'life3 dyn MigrationRunner, ) -> Pin<Box<dyn Future<Output = Result<ExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Execute a migration plan in dry-run mode

This validates the plan and returns what would happen, but doesn’t actually execute any changes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§