Skip to main content

generate_trait_abi

Function generate_trait_abi 

Source
fn generate_trait_abi(trait_item: &ItemTrait) -> TokenStream
Expand description

Generate the ABI infrastructure for a trait.

This is the main code generation function that produces:

  • Type tag constant
  • Vtable struct
  • View struct (skipped for generic traits)
  • Method shims (with trait type params threaded through)
  • Vtable builder (with trait type params threaded through)