pub enum MigrationStep {
SchemaDelta(Box<SchemaDeltaStep>),
Assertion {
contract: Box<AssertionStepContract>,
plan: Box<MigrationAssertionPlan>,
expected: AssertionExpectation,
},
Backfill {
contract: Box<BackfillStepContract>,
plan: Box<AttributeBackfillPlan>,
},
}Expand description
Exact ordered migration step algebra. Trusted steps deliberately do not deserialize.
Variants§
SchemaDelta(Box<SchemaDeltaStep>)
One state-changing schema delta.
Assertion
One state-preserving verifier-derived assertion.
Fields
contract: Box<AssertionStepContract>Constructor-derived assertion contract.
plan: Box<MigrationAssertionPlan>Canonical typed assertion plan.
expected: AssertionExpectationClosed expected outcome.
Backfill
One state-preserving schema, state-changing data backfill.
Fields
contract: Box<BackfillStepContract>Constructor-derived backfill contract.
plan: Box<AttributeBackfillPlan>Closed canonical data plan.
Implementations§
Source§impl MigrationStep
impl MigrationStep
Sourcepub fn backfill(
id: MigrationStepId,
plan: AttributeBackfillPlan,
) -> Result<Self, Diagnostic>
pub fn backfill( id: MigrationStepId, plan: AttributeBackfillPlan, ) -> Result<Self, Diagnostic>
Construct a trusted closed backfill step and derive all contract claims.
Sourcepub fn assertion(
id: MigrationStepId,
plan: MigrationAssertionPlan,
expected: AssertionExpectation,
) -> Result<Self, Diagnostic>
pub fn assertion( id: MigrationStepId, plan: MigrationAssertionPlan, expected: AssertionExpectation, ) -> Result<Self, Diagnostic>
Construct a trusted assertion step and derive all contract claims.
Sourcepub const fn kind(&self) -> MigrationStepKind
pub const fn kind(&self) -> MigrationStepKind
Return the closed step discriminator.
Sourcepub const fn id(&self) -> &MigrationStepId
pub const fn id(&self) -> &MigrationStepId
Return the unique step-local identity.
Sourcepub const fn required_capabilities(&self) -> &CapabilitySet
pub const fn required_capabilities(&self) -> &CapabilitySet
Return constructor-derived required capabilities.
Sourcepub fn as_schema_delta(&self) -> Option<&SchemaDeltaStep>
pub fn as_schema_delta(&self) -> Option<&SchemaDeltaStep>
Return a schema-delta step when this is state-changing.
Sourcepub fn as_assertion(
&self,
) -> Option<(&AssertionStepContract, &MigrationAssertionPlan, AssertionExpectation)>
pub fn as_assertion( &self, ) -> Option<(&AssertionStepContract, &MigrationAssertionPlan, AssertionExpectation)>
Return assertion contract, plan, and expectation when state-preserving.
Sourcepub fn as_backfill(
&self,
) -> Option<(&BackfillStepContract, &AttributeBackfillPlan)>
pub fn as_backfill( &self, ) -> Option<(&BackfillStepContract, &AttributeBackfillPlan)>
Return backfill contract and plan when this is a data step.
Sourcepub fn validate(&self) -> Result<(), Diagnostic>
pub fn validate(&self) -> Result<(), Diagnostic>
Rebuild all derived claims and reject an assembled mismatched step.
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>, Diagnostic>
pub fn canonical_bytes(&self) -> Result<Vec<u8>, Diagnostic>
Return exact canonical heterogeneous step bytes.