@@ -6,7 +6,7 @@ use crate::common::Text;
6
6
use crate :: schema:: ast:: * ;
7
7
8
8
9
- impl < ' a , T > Document < ' a , T >
9
+ impl < ' a , T > Document < ' a , T >
10
10
where T : Text < ' a > ,
11
11
{
12
12
/// Format a document according to style
@@ -33,7 +33,7 @@ fn description<'a>(description: &Option<String>, f: &mut Formatter) {
33
33
}
34
34
35
35
36
- impl < ' a , T > Displayable for Document < ' a , T >
36
+ impl < ' a , T > Displayable for Document < ' a , T >
37
37
where T : Text < ' a > ,
38
38
{
39
39
fn display ( & self , f : & mut Formatter ) {
@@ -43,7 +43,7 @@ impl<'a, T> Displayable for Document<'a, T>
43
43
}
44
44
}
45
45
46
- impl < ' a , T > Displayable for Definition < ' a , T >
46
+ impl < ' a , T > Displayable for Definition < ' a , T >
47
47
where T : Text < ' a > ,
48
48
{
49
49
fn display ( & self , f : & mut Formatter ) {
@@ -57,7 +57,7 @@ impl<'a, T> Displayable for Definition<'a, T>
57
57
}
58
58
}
59
59
60
- impl < ' a , T > Displayable for SchemaDefinition < ' a , T >
60
+ impl < ' a , T > Displayable for SchemaDefinition < ' a , T >
61
61
where T : Text < ' a > ,
62
62
{
63
63
fn display ( & self , f : & mut Formatter ) {
@@ -88,7 +88,7 @@ impl<'a, T> Displayable for SchemaDefinition<'a, T>
88
88
}
89
89
}
90
90
91
- impl < ' a , T > Displayable for TypeDefinition < ' a , T >
91
+ impl < ' a , T > Displayable for TypeDefinition < ' a , T >
92
92
where T : Text < ' a > ,
93
93
{
94
94
fn display ( & self , f : & mut Formatter ) {
@@ -103,7 +103,7 @@ impl<'a, T> Displayable for TypeDefinition<'a, T>
103
103
}
104
104
}
105
105
106
- impl < ' a , T > Displayable for ScalarType < ' a , T >
106
+ impl < ' a , T > Displayable for ScalarType < ' a , T >
107
107
where T : Text < ' a > ,
108
108
{
109
109
fn display ( & self , f : & mut Formatter ) {
@@ -116,7 +116,7 @@ impl<'a, T> Displayable for ScalarType<'a, T>
116
116
}
117
117
}
118
118
119
- impl < ' a , T > Displayable for ScalarTypeExtension < ' a , T >
119
+ impl < ' a , T > Displayable for ScalarTypeExtension < ' a , T >
120
120
where T : Text < ' a > ,
121
121
{
122
122
fn display ( & self , f : & mut Formatter ) {
@@ -128,7 +128,7 @@ impl<'a, T> Displayable for ScalarTypeExtension<'a, T>
128
128
}
129
129
}
130
130
131
- fn format_fields < ' a , T > ( fields : & [ Field < ' a , T > ] , f : & mut Formatter )
131
+ fn format_fields < ' a , T > ( fields : & [ Field < ' a , T > ] , f : & mut Formatter )
132
132
where T : Text < ' a > ,
133
133
{
134
134
if !fields. is_empty ( ) {
@@ -143,7 +143,7 @@ fn format_fields<'a, T>(fields: &[Field<'a, T>], f: &mut Formatter)
143
143
}
144
144
}
145
145
146
- impl < ' a , T > Displayable for ObjectType < ' a , T >
146
+ impl < ' a , T > Displayable for ObjectType < ' a , T >
147
147
where T : Text < ' a > ,
148
148
{
149
149
fn display ( & self , f : & mut Formatter ) {
@@ -164,7 +164,7 @@ impl<'a, T> Displayable for ObjectType<'a, T>
164
164
}
165
165
}
166
166
167
- impl < ' a , T > Displayable for ObjectTypeExtension < ' a , T >
167
+ impl < ' a , T > Displayable for ObjectTypeExtension < ' a , T >
168
168
where T : Text < ' a > ,
169
169
{
170
170
fn display ( & self , f : & mut Formatter ) {
@@ -184,7 +184,7 @@ impl<'a, T> Displayable for ObjectTypeExtension<'a, T>
184
184
}
185
185
}
186
186
187
- impl < ' a , T > Displayable for InputValue < ' a , T >
187
+ impl < ' a , T > Displayable for InputValue < ' a , T >
188
188
where T : Text < ' a > ,
189
189
{
190
190
fn display ( & self , f : & mut Formatter ) {
@@ -203,7 +203,7 @@ impl<'a, T> Displayable for InputValue<'a, T>
203
203
}
204
204
}
205
205
206
- fn format_arguments < ' a , T > ( arguments : & [ InputValue < ' a , T > ] , f : & mut Formatter )
206
+ fn format_arguments < ' a , T > ( arguments : & [ InputValue < ' a , T > ] , f : & mut Formatter )
207
207
where T : Text < ' a > ,
208
208
{
209
209
if !arguments. is_empty ( ) {
@@ -217,7 +217,7 @@ fn format_arguments<'a, T>(arguments: &[InputValue<'a, T>], f: &mut Formatter)
217
217
}
218
218
}
219
219
220
- impl < ' a , T > Displayable for Field < ' a , T >
220
+ impl < ' a , T > Displayable for Field < ' a , T >
221
221
where T : Text < ' a > ,
222
222
{
223
223
fn display ( & self , f : & mut Formatter ) {
@@ -232,32 +232,48 @@ impl<'a, T> Displayable for Field<'a, T>
232
232
}
233
233
}
234
234
235
- impl < ' a , T > Displayable for InterfaceType < ' a , T >
235
+ impl < ' a , T > Displayable for InterfaceType < ' a , T >
236
236
where T : Text < ' a > ,
237
237
{
238
238
fn display ( & self , f : & mut Formatter ) {
239
239
description ( & self . description , f) ;
240
240
f. indent ( ) ;
241
241
f. write ( "interface " ) ;
242
242
f. write ( self . name . as_ref ( ) ) ;
243
+ if !self . implements_interfaces . is_empty ( ) {
244
+ f. write ( " implements " ) ;
245
+ f. write ( self . implements_interfaces [ 0 ] . as_ref ( ) ) ;
246
+ for name in & self . implements_interfaces [ 1 ..] {
247
+ f. write ( " & " ) ;
248
+ f. write ( name. as_ref ( ) ) ;
249
+ }
250
+ }
243
251
format_directives ( & self . directives , f) ;
244
252
format_fields ( & self . fields , f) ;
245
253
}
246
254
}
247
255
248
- impl < ' a , T > Displayable for InterfaceTypeExtension < ' a , T >
256
+ impl < ' a , T > Displayable for InterfaceTypeExtension < ' a , T >
249
257
where T : Text < ' a > ,
250
258
{
251
259
fn display ( & self , f : & mut Formatter ) {
252
260
f. indent ( ) ;
253
261
f. write ( "extend interface " ) ;
254
262
f. write ( self . name . as_ref ( ) ) ;
263
+ if !self . implements_interfaces . is_empty ( ) {
264
+ f. write ( " implements " ) ;
265
+ f. write ( self . implements_interfaces [ 0 ] . as_ref ( ) ) ;
266
+ for name in & self . implements_interfaces [ 1 ..] {
267
+ f. write ( " & " ) ;
268
+ f. write ( name. as_ref ( ) ) ;
269
+ }
270
+ }
255
271
format_directives ( & self . directives , f) ;
256
272
format_fields ( & self . fields , f) ;
257
273
}
258
274
}
259
275
260
- impl < ' a , T > Displayable for UnionType < ' a , T >
276
+ impl < ' a , T > Displayable for UnionType < ' a , T >
261
277
where T : Text < ' a > ,
262
278
{
263
279
fn display ( & self , f : & mut Formatter ) {
@@ -278,7 +294,7 @@ impl<'a, T> Displayable for UnionType<'a, T>
278
294
}
279
295
}
280
296
281
- impl < ' a , T > Displayable for UnionTypeExtension < ' a , T >
297
+ impl < ' a , T > Displayable for UnionTypeExtension < ' a , T >
282
298
where T : Text < ' a > ,
283
299
{
284
300
fn display ( & self , f : & mut Formatter ) {
@@ -298,7 +314,7 @@ impl<'a, T> Displayable for UnionTypeExtension<'a, T>
298
314
}
299
315
}
300
316
301
- impl < ' a , T > Displayable for EnumType < ' a , T >
317
+ impl < ' a , T > Displayable for EnumType < ' a , T >
302
318
where T : Text < ' a > ,
303
319
{
304
320
fn display ( & self , f : & mut Formatter ) {
@@ -327,7 +343,7 @@ impl<'a, T> Displayable for EnumType<'a, T>
327
343
}
328
344
}
329
345
330
- impl < ' a , T > Displayable for EnumTypeExtension < ' a , T >
346
+ impl < ' a , T > Displayable for EnumTypeExtension < ' a , T >
331
347
where T : Text < ' a > ,
332
348
{
333
349
fn display ( & self , f : & mut Formatter ) {
@@ -355,7 +371,7 @@ impl<'a, T> Displayable for EnumTypeExtension<'a, T>
355
371
}
356
372
}
357
373
358
- fn format_inputs < ' a , T > ( fields : & [ InputValue < ' a , T > ] , f : & mut Formatter )
374
+ fn format_inputs < ' a , T > ( fields : & [ InputValue < ' a , T > ] , f : & mut Formatter )
359
375
where T : Text < ' a > ,
360
376
{
361
377
if !fields. is_empty ( ) {
@@ -372,7 +388,7 @@ fn format_inputs<'a, T>(fields: &[InputValue<'a, T>], f: &mut Formatter)
372
388
}
373
389
}
374
390
375
- impl < ' a , T > Displayable for InputObjectType < ' a , T >
391
+ impl < ' a , T > Displayable for InputObjectType < ' a , T >
376
392
where T : Text < ' a > ,
377
393
{
378
394
fn display ( & self , f : & mut Formatter ) {
@@ -385,7 +401,7 @@ impl<'a, T> Displayable for InputObjectType<'a, T>
385
401
}
386
402
}
387
403
388
- impl < ' a , T > Displayable for InputObjectTypeExtension < ' a , T >
404
+ impl < ' a , T > Displayable for InputObjectTypeExtension < ' a , T >
389
405
where T : Text < ' a > ,
390
406
{
391
407
fn display ( & self , f : & mut Formatter ) {
@@ -397,7 +413,7 @@ impl<'a, T> Displayable for InputObjectTypeExtension<'a, T>
397
413
}
398
414
}
399
415
400
- impl < ' a , T > Displayable for TypeExtension < ' a , T >
416
+ impl < ' a , T > Displayable for TypeExtension < ' a , T >
401
417
where T : Text < ' a > ,
402
418
{
403
419
fn display ( & self , f : & mut Formatter ) {
@@ -412,7 +428,7 @@ impl<'a, T> Displayable for TypeExtension<'a, T>
412
428
}
413
429
}
414
430
415
- impl < ' a , T > Displayable for DirectiveDefinition < ' a , T >
431
+ impl < ' a , T > Displayable for DirectiveDefinition < ' a , T >
416
432
where T : Text < ' a > ,
417
433
{
418
434
fn display ( & self , f : & mut Formatter ) {
@@ -441,7 +457,7 @@ impl<'a, T> Displayable for DirectiveDefinition<'a, T>
441
457
}
442
458
443
459
impl_display ! (
444
- ' a
460
+ ' a
445
461
Document ,
446
462
Definition ,
447
463
SchemaDefinition ,
0 commit comments