pub struct MigrationHistoryGraph { /* private fields */ }Expand description
A validated DAG whose only node authority is a verified canonical manifest.
Implementations§
Source§impl MigrationHistoryGraph
impl MigrationHistoryGraph
Sourcepub fn from_verified(
manifests: impl IntoIterator<Item = VerifiedSchemaMigrationManifest>,
) -> Result<Self, Diagnostic>
pub fn from_verified( manifests: impl IntoIterator<Item = VerifiedSchemaMigrationManifest>, ) -> Result<Self, Diagnostic>
Build and validate a complete history graph from verified manifests only.
Sourcepub fn manifest(
&self,
id: &MigrationId,
) -> Option<&VerifiedSchemaMigrationManifest>
pub fn manifest( &self, id: &MigrationId, ) -> Option<&VerifiedSchemaMigrationManifest>
Return one verified manifest by compound identity.
Sourcepub fn manifests(
&self,
) -> impl ExactSizeIterator<Item = (&MigrationId, &VerifiedSchemaMigrationManifest)>
pub fn manifests( &self, ) -> impl ExactSizeIterator<Item = (&MigrationId, &VerifiedSchemaMigrationManifest)>
Iterate verified manifests in compound-identity order.
Sourcepub fn topological_order(&self) -> &[MigrationId]
pub fn topological_order(&self) -> &[MigrationId]
Return deterministic topological order with compound-ID ready-node ties.
Sourcepub fn heads(&self) -> &[MigrationId]
pub fn heads(&self) -> &[MigrationId]
Return every graph head in compound-identity order.
Sourcepub fn default_head(&self) -> Result<Option<&MigrationId>, Diagnostic>
pub fn default_head(&self) -> Result<Option<&MigrationId>, Diagnostic>
Return the implicit default head, rejecting ambiguous multi-head history.
Sourcepub fn validate_applied(
&self,
applied: &BTreeSet<MigrationId>,
) -> Result<(), Diagnostic>
pub fn validate_applied( &self, applied: &BTreeSet<MigrationId>, ) -> Result<(), Diagnostic>
Require an applied set to contain every ancestor of every applied node.
Sourcepub fn applied_frontier(
&self,
applied: &BTreeSet<MigrationId>,
) -> Result<Vec<MigrationId>, Diagnostic>
pub fn applied_frontier( &self, applied: &BTreeSet<MigrationId>, ) -> Result<Vec<MigrationId>, Diagnostic>
Return maximal applied nodes, which form the applied reachability frontier.
Sourcepub fn plan_apply(
&self,
applied: &BTreeSet<MigrationId>,
targets: &BTreeSet<MigrationId>,
) -> Result<Vec<MigrationId>, Diagnostic>
pub fn plan_apply( &self, applied: &BTreeSet<MigrationId>, targets: &BTreeSet<MigrationId>, ) -> Result<Vec<MigrationId>, Diagnostic>
Plan the missing ancestor closure for explicit target nodes.
Sourcepub fn plan_apply_to_default_head(
&self,
applied: &BTreeSet<MigrationId>,
) -> Result<Vec<MigrationId>, Diagnostic>
pub fn plan_apply_to_default_head( &self, applied: &BTreeSet<MigrationId>, ) -> Result<Vec<MigrationId>, Diagnostic>
Plan application to the sole implicit head.
Sourcepub fn plan_rollback(
&self,
applied: &BTreeSet<MigrationId>,
removals: &BTreeSet<MigrationId>,
) -> Result<Vec<MigrationId>, Diagnostic>
pub fn plan_rollback( &self, applied: &BTreeSet<MigrationId>, removals: &BTreeSet<MigrationId>, ) -> Result<Vec<MigrationId>, Diagnostic>
Reverse-topologically order an explicit rollback set.
A node cannot be rolled back while any applied descendant remains.
Trait Implementations§
Source§impl Clone for MigrationHistoryGraph
impl Clone for MigrationHistoryGraph
Source§fn clone(&self) -> MigrationHistoryGraph
fn clone(&self) -> MigrationHistoryGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more