pub trait InterfaceGenerator<'a> {
Show 14 methods // Required methods fn resolve(&self) -> &'a Resolve; fn type_record( &mut self, id: TypeId, name: &str, record: &Record, docs: &Docs ); fn type_resource(&mut self, id: TypeId, name: &str, docs: &Docs); fn type_flags(&mut self, id: TypeId, name: &str, flags: &Flags, docs: &Docs); fn type_tuple(&mut self, id: TypeId, name: &str, flags: &Tuple, docs: &Docs); fn type_variant( &mut self, id: TypeId, name: &str, variant: &Variant, docs: &Docs ); fn type_option( &mut self, id: TypeId, name: &str, payload: &Type, docs: &Docs ); fn type_result( &mut self, id: TypeId, name: &str, result: &Result_, docs: &Docs ); fn type_enum(&mut self, id: TypeId, name: &str, enum_: &Enum, docs: &Docs); fn type_alias(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs); fn type_list(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs); fn type_builtin(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs); // Provided methods fn types(&mut self, iface: InterfaceId) { ... } fn define_type(&mut self, name: &str, id: TypeId) { ... }
}
Expand description

This is a possible replacement for the Generator trait above, currently only used by the JS bindings for generating bindings for a component.

The current plan is to see how things shake out with worlds and various other generators to see if everything can be updated to a less per-*.wit-file centric interface in the future. Even this will probably change for JS though. In any case it’s something that was useful for JS and is suitable to replace otherwise at any time.

Required Methods§

source

fn resolve(&self) -> &'a Resolve

source

fn type_record(&mut self, id: TypeId, name: &str, record: &Record, docs: &Docs)

source

fn type_resource(&mut self, id: TypeId, name: &str, docs: &Docs)

source

fn type_flags(&mut self, id: TypeId, name: &str, flags: &Flags, docs: &Docs)

source

fn type_tuple(&mut self, id: TypeId, name: &str, flags: &Tuple, docs: &Docs)

source

fn type_variant( &mut self, id: TypeId, name: &str, variant: &Variant, docs: &Docs )

source

fn type_option(&mut self, id: TypeId, name: &str, payload: &Type, docs: &Docs)

source

fn type_result(&mut self, id: TypeId, name: &str, result: &Result_, docs: &Docs)

source

fn type_enum(&mut self, id: TypeId, name: &str, enum_: &Enum, docs: &Docs)

source

fn type_alias(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs)

source

fn type_list(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs)

source

fn type_builtin(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs)

Provided Methods§

source

fn types(&mut self, iface: InterfaceId)

source

fn define_type(&mut self, name: &str, id: TypeId)

Implementors§