Skip to main content

Formatter

Trait Formatter 

Source
pub trait Formatter {
    // Required methods
    fn format(&self, ast: &AstNode) -> Result<String>;
    fn format_node(&self, node: &AstNode) -> Result<String>;
}
Expand description

Base trait for all formatters

Required Methods§

Source

fn format(&self, ast: &AstNode) -> Result<String>

Format an AST into a string

Source

fn format_node(&self, node: &AstNode) -> Result<String>

Format a single node

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§