Skip to main content

MigrationArgsBuilder

Struct MigrationArgsBuilder 

Source
pub struct MigrationArgsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> MigrationArgsBuilder<S>

Source

pub fn build(self) -> MigrationArgs
where S: IsComplete,

Finish building and return the requested object

Source

pub fn application_type( self, value: String, ) -> MigrationArgsBuilder<SetApplicationType<S>>
where S::ApplicationType: IsUnset,

Optional (Some / Option setters). The type of application whose candidate version was tried, echoed from the worklist entry’s application_type. Omitted by a consumer that predates the entry carrying it, in which case Canopy derives the application from the machine and the version.

Source

pub fn maybe_application_type( self, value: Option<String>, ) -> MigrationArgsBuilder<SetApplicationType<S>>
where S::ApplicationType: IsUnset,

Optional (Some / Option setters). The type of application whose candidate version was tried, echoed from the worklist entry’s application_type. Omitted by a consumer that predates the entry carrying it, in which case Canopy derives the application from the machine and the version.

Source

pub fn data_bytes_after( self, value: i64, ) -> MigrationArgsBuilder<SetDataBytesAfter<S>>
where S::DataBytesAfter: IsUnset,

Required.

Size of the data after they ran. The growth between the two is what shows a migration that backfills heavily.

Source

pub fn data_bytes_before( self, value: i64, ) -> MigrationArgsBuilder<SetDataBytesBefore<S>>
where S::DataBytesBefore: IsUnset,

Required.

Size of the data before the migrations ran.

Source

pub fn failed_migration( self, value: String, ) -> MigrationArgsBuilder<SetFailedMigration<S>>
where S::FailedMigration: IsUnset,

Optional (Some / Option setters). The migration that failed, when one did.

Source

pub fn maybe_failed_migration( self, value: Option<String>, ) -> MigrationArgsBuilder<SetFailedMigration<S>>
where S::FailedMigration: IsUnset,

Optional (Some / Option setters). The migration that failed, when one did.

Source

pub fn target_version( self, value: String, ) -> MigrationArgsBuilder<SetTargetVersion<S>>
where S::TargetVersion: IsUnset,

Optional (Some / Option setters). The version whose migrations were applied, as semver, taken from the worklist entry’s target_version. This is the version the consumer actually migrated to; send it in preference to echoing the identifier.

Source

pub fn maybe_target_version( self, value: Option<String>, ) -> MigrationArgsBuilder<SetTargetVersion<S>>
where S::TargetVersion: IsUnset,

Optional (Some / Option setters). The version whose migrations were applied, as semver, taken from the worklist entry’s target_version. This is the version the consumer actually migrated to; send it in preference to echoing the identifier.

Source

pub fn target_version_id( self, value: Uuid, ) -> MigrationArgsBuilder<SetTargetVersionId<S>>
where S::TargetVersionId: IsUnset,

Optional (Some / Option setters). The version whose migrations were applied, as the identifier a consumer echoes from the worklist entry’s target_version_id. Accepted only for older consumers that report the identifier; omit it when target_version is sent.

Source

pub fn maybe_target_version_id( self, value: Option<Uuid>, ) -> MigrationArgsBuilder<SetTargetVersionId<S>>
where S::TargetVersionId: IsUnset,

Optional (Some / Option setters). The version whose migrations were applied, as the identifier a consumer echoes from the worklist entry’s target_version_id. Accepted only for older consumers that report the identifier; omit it when target_version is sent.

Source

pub fn timings( self, value: Vec<MigrationTimingArgs>, ) -> MigrationArgsBuilder<SetTimings<S>>
where S::Timings: IsUnset,

Required.

One entry per migration that ran, in the order they ran.

Source

pub fn total_elapsed_seconds( self, value: i64, ) -> MigrationArgsBuilder<SetTotalElapsedSeconds<S>>
where S::TotalElapsedSeconds: IsUnset,

Required.

Whole seconds the whole migration run took.

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