pub trait ValidateNode<'a>{
// Provided method
fn validate<Rule: ValidationRule<'a>>(
&'a self,
ctx: &'a ASTContext,
) -> Result<()> { ... }
}
Expand description
Trait to run a ValidationRule
on a given GraphQL Document node.
Provided Methods§
Sourcefn validate<Rule: ValidationRule<'a>>(
&'a self,
ctx: &'a ASTContext,
) -> Result<()>
fn validate<Rule: ValidationRule<'a>>( &'a self, ctx: &'a ASTContext, ) -> Result<()>
Run the generic validation rule on the document node and return a result which errors if the validation rule fails on the current document.
document.validate::<YourValidationRule>(&ctx)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.