generator

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package generator is Rust generator from AST

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	BasePackage     string
	CustomGenerator func(t rstypes.Type) (generated string, union bool)
	// contains filtered or unexported fields
}

Generator is a generator for Rust types

func NewGenerator

func NewGenerator(types map[string]rstypes.Type) *Generator

Update NewGenerator

func (*Generator) AddTypes added in v0.1.4

func (g *Generator) AddTypes(typeMap map[reflect.Type]rstypes.Type)

Add new method

func (*Generator) Generate

func (g *Generator) Generate() string

func (*Generator) GenerateTypeSimple added in v0.1.3

func (g *Generator) GenerateTypeSimple(t rstypes.Type, fieldName string) string

func (*Generator) GenerateTypeSimpleWithContext added in v0.1.3

func (g *Generator) GenerateTypeSimpleWithContext(t rstypes.Type, fieldName string, typeStack []rstypes.Type) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL