StructureRenderer

Trait StructureRenderer 

Source
pub trait StructureRenderer {
    // Required methods
    fn render_struct(&self, spec: &StructSpec) -> String;
    fn render_enum(&self, spec: &EnumSpec) -> String;
    fn render_field(&self, spec: &FieldSpec) -> String;
    fn render_variant(&self, spec: &VariantSpec) -> String;
    fn render_attribute(&self, spec: &AttributeSpec) -> String;
    fn render_visibility(&self, vis: Visibility) -> &'static str;
}
Expand description

Trait for rendering structure specs to language-specific code.

Implement this trait to support rendering structs and enums in a new target language.

Required Methods§

Source

fn render_struct(&self, spec: &StructSpec) -> String

Render a struct specification to code.

Source

fn render_enum(&self, spec: &EnumSpec) -> String

Render an enum specification to code.

Source

fn render_field(&self, spec: &FieldSpec) -> String

Render a field specification to code.

Source

fn render_variant(&self, spec: &VariantSpec) -> String

Render a variant specification to code.

Source

fn render_attribute(&self, spec: &AttributeSpec) -> String

Render an attribute specification to code.

Source

fn render_visibility(&self, vis: Visibility) -> &'static str

Render a visibility modifier to code.

Implementors§