Skip to main content

GrammarRenderer

Trait GrammarRenderer 

Source
pub trait GrammarRenderer {
    // Required methods
    fn codec_symbol(&self) -> Symbol;
    fn dialect(&self) -> GrammarDialect;
    fn render(
        &self,
        graph: &GrammarGraph,
        position: GrammarPosition,
    ) -> Result<String>;
}
Expand description

Renders a neutral GrammarGraph into one concrete codec grammar surface.

Required Methods§

Source

fn codec_symbol(&self) -> Symbol

Codec symbol this renderer targets.

Source

fn dialect(&self) -> GrammarDialect

Concrete grammar dialect this renderer emits.

Source

fn render( &self, graph: &GrammarGraph, position: GrammarPosition, ) -> Result<String>

Renders graph for this codec at position.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§