Expand description
A bunch of utilities used by the actual code emit functions
Structs§
- Mod
- A representation of a module definition that we will eventually emit. This is used to allow easily adding onto the module each time we see a relevant decl.
- State
- A whole grab-bag of useful state to have while emitting Rust
- Trait
- A representation of a trait definition that we will eventually emit. This is used to allow easily adding onto the trait each time we see an extern decl.
- WitName
- A parsed representation of a WIT name, containing package namespaces, an actual name, and possibly a SemVer version
Enums§
- FnName
- The kinds of names that a function in WIT can have
- Resolved
Bound Var - Unlike [
tv::ResolvedTyvar
], which is mostly concerned with free variables and leaves bound variables alone, this tells us the most information that we have at codegen time for a top level bound variable. - Resource
Item Name - The kinds of names that a function associated with a resource in WIT can have
Functions§
- kebab_
to_ cons - Convert a kebab name to something suitable for use as a type constructor
- kebab_
to_ exports_ name - From a kebab name for a Component, derive something suitable for use as the name of the imports trait for that component
- kebab_
to_ fn - Parse a kebab-name as a WIT function name, figuring out if it is associated with a resource
- kebab_
to_ getter - Convert a kebab name to something suitable for use as a getter function name
- kebab_
to_ imports_ name - From a kebab name for a Component, derive something suitable for use as the name of the imports trait for that component
- kebab_
to_ namespace - Convert a kebab name to something suitable for use as a module name/namespace path entry
- kebab_
to_ type - Convert a kebab name to something suitable for use as a type name
- kebab_
to_ var - Convert a kebab name to something suitable for use as a (value-level) variable
- run_
state - Create a State with all of its &mut references pointing to sensible things, run a function that emits code into the state, and then generate a token stream representing everything emitted
- split_
wit_ name - Parse a kebab-name as a WIT name