pub struct DependencyGraph { /* private fields */ }Expand description
Dependency graph for federation @requires directives
Represents dependencies between fields based on @requires directives. Used to detect cycles and determine resolution order.
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn build(metadata: &FederationMetadata) -> Result<Self, String>
pub fn build(metadata: &FederationMetadata) -> Result<Self, String>
Build a dependency graph from federation metadata
Scans all types and fields for @requires directives and constructs a directed graph where edges represent dependencies.
§Errors
Returns error if graph construction fails (should not happen in normal operation).
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes in the graph
Sourcepub fn detect_cycles(&self) -> Vec<Vec<String>>
pub fn detect_cycles(&self) -> Vec<Vec<String>>
Detect cycles in the dependency graph using DFS
Returns a vector of cycles, where each cycle is a vector of node IDs that form a circular dependency.
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