pub struct DependencyGraph { /* private fields */ }Expand description
A directed acyclic graph of migration dependencies.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn build(
migrations: &[&ResolvedMigration],
implicit_chain: bool,
) -> Result<Self>
pub fn build( migrations: &[&ResolvedMigration], implicit_chain: bool, ) -> Result<Self>
Build a dependency graph from resolved migrations.
If implicit_chain is true, each versioned migration implicitly depends
on the previous version in sort order (backward-compatible default).
Sourcepub fn topological_sort(&self) -> Result<Vec<String>>
pub fn topological_sort(&self) -> Result<Vec<String>>
Produce a topologically sorted order of versions using Kahn’s algorithm.
Uses borrowed &str references internally to avoid cloning during
the sort; only clones into owned Strings for the output.
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more