Trait ParseNode

Source
pub trait ParseNode<'a>: ParseNode<'a> {
    // Provided method
    fn parse<T: ToString>(ctx: &'a ASTContext, source: T) -> Result<&'a Self> { ... }
}
Expand description

Trait for parsing AST Nodes from source texts using recursive descent and a lexer.

This trait is implemented by all AST Nodes and can hence be used to granularly parse GraphQL language. However, mostly this will be used via Document::parse.

Provided Methods§

Source

fn parse<T: ToString>(ctx: &'a ASTContext, source: T) -> Result<&'a Self>

Parse an input source text into the implementor’s AST Node structure and allocate the resulting AST into the current AST Context’s arena.

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, T: ParseNode<'a>> ParseNode<'a> for T