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§
Sourcefn render_struct(&self, spec: &StructSpec) -> String
fn render_struct(&self, spec: &StructSpec) -> String
Render a struct specification to code.
Sourcefn render_enum(&self, spec: &EnumSpec) -> String
fn render_enum(&self, spec: &EnumSpec) -> String
Render an enum specification to code.
Sourcefn render_field(&self, spec: &FieldSpec) -> String
fn render_field(&self, spec: &FieldSpec) -> String
Render a field specification to code.
Sourcefn render_variant(&self, spec: &VariantSpec) -> String
fn render_variant(&self, spec: &VariantSpec) -> String
Render a variant specification to code.
Sourcefn render_attribute(&self, spec: &AttributeSpec) -> String
fn render_attribute(&self, spec: &AttributeSpec) -> String
Render an attribute specification to code.
Sourcefn render_visibility(&self, vis: Visibility) -> &'static str
fn render_visibility(&self, vis: Visibility) -> &'static str
Render a visibility modifier to code.