Module generate

Module generate 

Source
Expand description

Code to help generate functions.

The structure is:

Afterwards, Generator::finish() must be called to take out the TokenStream produced.

Structs§

FieldBuilder
A builder for struct or enum variant fields.
FnBuilder
A builder for functions.
GenConst
A builder for constants.
GenEnum
Builder to generate an enum <Name> { <value> { ... }, ... }
GenStruct
Builder to generate a struct. Defaults to a struct with named fields struct <Name> { <field>: <ty>, ... }
GenerateMod
Builder for generating a module with its contents.
Generator
The generator is used to generate code.
Impl
A helper struct for implementing functions for a given struct or enum.
ImplFor
A helper struct for implementing a trait for a given struct or enum.
Path
A path of identifiers, like mod::Type.
PushParseError
Failed to parse the code passed to StreamBuilder::push_parsed
StreamBuilder
A helper struct build around a TokenStream to make it easier to build code.

Enums§

FnSelfArg
The self argument of a function
StringOrIdent
Helper enum to differentiate between a Ident or a String.

Traits§

Parent
Helper trait to make it possible to nest several builders. Internal use only.