MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / types

Method types

crates/cpp/src/lib.rs:880–890  ·  view source on GitHub ↗
(&mut self, iface: InterfaceId)

Source from the content-addressed store, hash-verified

878
879impl CppInterfaceGenerator<'_> {
880 fn types(&mut self, iface: InterfaceId) {
881 let iface_data = &self.resolve().interfaces[iface];
882
883 // Here we sort the types topologically before emitting code for them,
884 // taking into consideration the parameter and return types of functions
885 // associated with resource types. This ensures each type is declared
886 // before any uses of it.
887 for (name, id) in sort_types(self.resolve, &iface_data.types) {
888 self.define_type(name, id);
889 }
890 }
891
892 fn define_type(&mut self, name: &str, id: TypeId) {
893 let ty = &self.resolve().types[id];

Callers 8

import_interfaceMethod · 0.45
export_interfaceMethod · 0.45
import_interfaceMethod · 0.45
export_interfaceMethod · 0.45
import_interfaceMethod · 0.45
export_interfaceMethod · 0.45
import_interfaceMethod · 0.45
export_interfaceMethod · 0.45

Calls 3

sort_typesFunction · 0.85
resolveMethod · 0.45
define_typeMethod · 0.45

Tested by

no test coverage detected