Skip to main content

MigrationStep

Enum MigrationStep 

Source
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: AssertionExpectation

Closed 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

Source

pub fn backfill( id: MigrationStepId, plan: AttributeBackfillPlan, ) -> Result<Self, Diagnostic>

Construct a trusted closed backfill step and derive all contract claims.

Source

pub fn assertion( id: MigrationStepId, plan: MigrationAssertionPlan, expected: AssertionExpectation, ) -> Result<Self, Diagnostic>

Construct a trusted assertion step and derive all contract claims.

Source

pub const fn kind(&self) -> MigrationStepKind

Return the closed step discriminator.

Source

pub const fn id(&self) -> &MigrationStepId

Return the unique step-local identity.

Source

pub const fn required_capabilities(&self) -> &CapabilitySet

Return constructor-derived required capabilities.

Source

pub fn as_schema_delta(&self) -> Option<&SchemaDeltaStep>

Return a schema-delta step when this is state-changing.

Source

pub fn as_assertion( &self, ) -> Option<(&AssertionStepContract, &MigrationAssertionPlan, AssertionExpectation)>

Return assertion contract, plan, and expectation when state-preserving.

Source

pub fn as_backfill( &self, ) -> Option<(&BackfillStepContract, &AttributeBackfillPlan)>

Return backfill contract and plan when this is a data step.

Source

pub fn validate(&self) -> Result<(), Diagnostic>

Rebuild all derived claims and reject an assembled mismatched step.

Source

pub fn canonical_bytes(&self) -> Result<Vec<u8>, Diagnostic>

Return exact canonical heterogeneous step bytes.

Trait Implementations§

Source§

impl Clone for MigrationStep

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MigrationStep

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MigrationStep

Source§

impl From<SchemaDeltaStep> for MigrationStep

Source§

fn from(step: SchemaDeltaStep) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MigrationStep

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MigrationStep

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MigrationStep

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.