Trait ValidateNode

Source
pub trait ValidateNode<'a>
where Self: Borrow<Document<'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§

Source

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.

Implementors§

Source§

impl<'a> ValidateNode<'a> for Document<'a>