pub struct CrossSubgraphValidator { /* private fields */ }Expand description
Validator for cross-subgraph federation consistency
Validates that multiple federated subgraphs form a valid federation by checking:
- @key directive consistency across all subgraphs
- @external field ownership rules
- @shareable field consistency
Named subgraphs are used in error messages for clear debugging context.
Implementations§
Source§impl CrossSubgraphValidator
impl CrossSubgraphValidator
Sourcepub fn new(subgraphs: Vec<(String, FederationMetadata)>) -> Self
pub fn new(subgraphs: Vec<(String, FederationMetadata)>) -> Self
Create a new cross-subgraph validator with named subgraphs
§Arguments
subgraphs: Vector of (subgraph_name, metadata) tuples
Subgraph names are used in error messages to identify problem sources.
Sourcepub fn validate_consistency(&self) -> Result<(), Vec<CompositionError>>
pub fn validate_consistency(&self) -> Result<(), Vec<CompositionError>>
Validate consistency across all subgraphs
Performs comprehensive cross-subgraph validation and collects all errors before returning. This allows callers to see all problems at once.
§Errors
Returns Err with vector of all consistency errors found.
Returns Ok(()) if all validation passes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrossSubgraphValidator
impl RefUnwindSafe for CrossSubgraphValidator
impl Send for CrossSubgraphValidator
impl Sync for CrossSubgraphValidator
impl Unpin for CrossSubgraphValidator
impl UnsafeUnpin for CrossSubgraphValidator
impl UnwindSafe for CrossSubgraphValidator
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