@@ -170,6 +170,9 @@ pub trait InterfaceGenerator<'a> {
170
170
fn type_alias ( & mut self , id : TypeId , name : & str , ty : & Type , docs : & Docs ) ;
171
171
fn type_list ( & mut self , id : TypeId , name : & str , ty : & Type , docs : & Docs ) ;
172
172
fn type_builtin ( & mut self , id : TypeId , name : & str , ty : & Type , docs : & Docs ) ;
173
+ fn type_future ( & mut self , id : TypeId , name : & str , ty : & Option < Type > , docs : & Docs ) ;
174
+ fn type_stream ( & mut self , id : TypeId , name : & str , ty : & Type , docs : & Docs ) ;
175
+ fn type_error_context ( & mut self , id : TypeId , name : & str , docs : & Docs ) ;
173
176
fn types ( & mut self , iface : InterfaceId ) {
174
177
let iface = & self . resolve ( ) . interfaces [ iface] ;
175
178
for ( name, id) in iface. types . iter ( ) {
@@ -190,12 +193,10 @@ pub trait InterfaceGenerator<'a> {
190
193
TypeDefKind :: Result ( r) => self . type_result ( id, name, r, & ty. docs ) ,
191
194
TypeDefKind :: List ( t) => self . type_list ( id, name, t, & ty. docs ) ,
192
195
TypeDefKind :: Type ( t) => self . type_alias ( id, name, t, & ty. docs ) ,
193
- TypeDefKind :: Future ( _ ) => panic ! ( "future types do not require definition" ) ,
194
- TypeDefKind :: Stream ( _ ) => panic ! ( "stream types do not require definition" ) ,
196
+ TypeDefKind :: Future ( t ) => self . type_future ( id , name , t , & ty . docs ) ,
197
+ TypeDefKind :: Stream ( t ) => self . type_stream ( id , name , t , & ty . docs ) ,
195
198
TypeDefKind :: Handle ( _) => panic ! ( "handle types do not require definition" ) ,
196
- TypeDefKind :: ErrorContext => {
197
- panic ! ( "the error-context type does not require definition" )
198
- }
199
+ TypeDefKind :: ErrorContext => self . type_error_context ( id, name, & ty. docs ) ,
199
200
TypeDefKind :: Unknown => unreachable ! ( ) ,
200
201
}
201
202
}
0 commit comments