pub struct ConstructionGraph { /* private fields */ }Expand description
A caller-owned set of construction dependencies for cycle validation.
Implementations§
Source§impl ConstructionGraph
impl ConstructionGraph
Sourcepub fn new(dependencies: Vec<ConstructionDependency>) -> Self
pub fn new(dependencies: Vec<ConstructionDependency>) -> Self
Creates a graph from module-to-module construction dependencies.
Sourcepub fn dependencies(&self) -> &[ConstructionDependency]
pub fn dependencies(&self) -> &[ConstructionDependency]
Returns the declared construction dependencies.
Sourcepub fn validate(&self) -> Result<(), ConstructionCycle>
pub fn validate(&self) -> Result<(), ConstructionCycle>
Rejects a construction cycle and returns its closed module path.
For example, A -> B -> C -> A reports [A, B, C, A]. Traversal is
sorted by stable module identity, so the selected diagnostic is
independent of dependency registration order.
Trait Implementations§
Source§impl Clone for ConstructionGraph
impl Clone for ConstructionGraph
Source§impl Debug for ConstructionGraph
impl Debug for ConstructionGraph
Auto Trait Implementations§
impl Freeze for ConstructionGraph
impl RefUnwindSafe for ConstructionGraph
impl Send for ConstructionGraph
impl Sync for ConstructionGraph
impl Unpin for ConstructionGraph
impl UnsafeUnpin for ConstructionGraph
impl UnwindSafe for ConstructionGraph
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