(&mut self, iface: InterfaceId)
| 878 | |
| 879 | impl 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]; |
no test coverage detected