icrate 0.1.2

Bindings to Apple's frameworks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;
use crate::Metal::*;

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum MTLDataType {
        MTLDataTypeNone = 0,
        MTLDataTypeStruct = 1,
        MTLDataTypeArray = 2,
        MTLDataTypeFloat = 3,
        MTLDataTypeFloat2 = 4,
        MTLDataTypeFloat3 = 5,
        MTLDataTypeFloat4 = 6,
        MTLDataTypeFloat2x2 = 7,
        MTLDataTypeFloat2x3 = 8,
        MTLDataTypeFloat2x4 = 9,
        MTLDataTypeFloat3x2 = 10,
        MTLDataTypeFloat3x3 = 11,
        MTLDataTypeFloat3x4 = 12,
        MTLDataTypeFloat4x2 = 13,
        MTLDataTypeFloat4x3 = 14,
        MTLDataTypeFloat4x4 = 15,
        MTLDataTypeHalf = 16,
        MTLDataTypeHalf2 = 17,
        MTLDataTypeHalf3 = 18,
        MTLDataTypeHalf4 = 19,
        MTLDataTypeHalf2x2 = 20,
        MTLDataTypeHalf2x3 = 21,
        MTLDataTypeHalf2x4 = 22,
        MTLDataTypeHalf3x2 = 23,
        MTLDataTypeHalf3x3 = 24,
        MTLDataTypeHalf3x4 = 25,
        MTLDataTypeHalf4x2 = 26,
        MTLDataTypeHalf4x3 = 27,
        MTLDataTypeHalf4x4 = 28,
        MTLDataTypeInt = 29,
        MTLDataTypeInt2 = 30,
        MTLDataTypeInt3 = 31,
        MTLDataTypeInt4 = 32,
        MTLDataTypeUInt = 33,
        MTLDataTypeUInt2 = 34,
        MTLDataTypeUInt3 = 35,
        MTLDataTypeUInt4 = 36,
        MTLDataTypeShort = 37,
        MTLDataTypeShort2 = 38,
        MTLDataTypeShort3 = 39,
        MTLDataTypeShort4 = 40,
        MTLDataTypeUShort = 41,
        MTLDataTypeUShort2 = 42,
        MTLDataTypeUShort3 = 43,
        MTLDataTypeUShort4 = 44,
        MTLDataTypeChar = 45,
        MTLDataTypeChar2 = 46,
        MTLDataTypeChar3 = 47,
        MTLDataTypeChar4 = 48,
        MTLDataTypeUChar = 49,
        MTLDataTypeUChar2 = 50,
        MTLDataTypeUChar3 = 51,
        MTLDataTypeUChar4 = 52,
        MTLDataTypeBool = 53,
        MTLDataTypeBool2 = 54,
        MTLDataTypeBool3 = 55,
        MTLDataTypeBool4 = 56,
        MTLDataTypeTexture = 58,
        MTLDataTypeSampler = 59,
        MTLDataTypePointer = 60,
        MTLDataTypeR8Unorm = 62,
        MTLDataTypeR8Snorm = 63,
        MTLDataTypeR16Unorm = 64,
        MTLDataTypeR16Snorm = 65,
        MTLDataTypeRG8Unorm = 66,
        MTLDataTypeRG8Snorm = 67,
        MTLDataTypeRG16Unorm = 68,
        MTLDataTypeRG16Snorm = 69,
        MTLDataTypeRGBA8Unorm = 70,
        MTLDataTypeRGBA8Unorm_sRGB = 71,
        MTLDataTypeRGBA8Snorm = 72,
        MTLDataTypeRGBA16Unorm = 73,
        MTLDataTypeRGBA16Snorm = 74,
        MTLDataTypeRGB10A2Unorm = 75,
        MTLDataTypeRG11B10Float = 76,
        MTLDataTypeRGB9E5Float = 77,
        MTLDataTypeRenderPipeline = 78,
        MTLDataTypeComputePipeline = 79,
        MTLDataTypeIndirectCommandBuffer = 80,
        MTLDataTypeLong = 81,
        MTLDataTypeLong2 = 82,
        MTLDataTypeLong3 = 83,
        MTLDataTypeLong4 = 84,
        MTLDataTypeULong = 85,
        MTLDataTypeULong2 = 86,
        MTLDataTypeULong3 = 87,
        MTLDataTypeULong4 = 88,
        MTLDataTypeVisibleFunctionTable = 115,
        MTLDataTypeIntersectionFunctionTable = 116,
        MTLDataTypePrimitiveAccelerationStructure = 117,
        MTLDataTypeInstanceAccelerationStructure = 118,
        MTLDataTypeBFloat = 121,
        MTLDataTypeBFloat2 = 122,
        MTLDataTypeBFloat3 = 123,
        MTLDataTypeBFloat4 = 124,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum MTLBindingType {
        MTLBindingTypeBuffer = 0,
        MTLBindingTypeThreadgroupMemory = 1,
        MTLBindingTypeTexture = 2,
        MTLBindingTypeSampler = 3,
        MTLBindingTypeImageblockData = 16,
        MTLBindingTypeImageblock = 17,
        MTLBindingTypeVisibleFunctionTable = 24,
        MTLBindingTypePrimitiveAccelerationStructure = 25,
        MTLBindingTypeInstanceAccelerationStructure = 26,
        MTLBindingTypeIntersectionFunctionTable = 27,
        MTLBindingTypeObjectPayload = 34,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    #[deprecated]
    pub enum MTLArgumentType {
        #[deprecated]
        MTLArgumentTypeBuffer = 0,
        #[deprecated]
        MTLArgumentTypeThreadgroupMemory = 1,
        #[deprecated]
        MTLArgumentTypeTexture = 2,
        #[deprecated]
        MTLArgumentTypeSampler = 3,
        MTLArgumentTypeImageblockData = 16,
        MTLArgumentTypeImageblock = 17,
        MTLArgumentTypeVisibleFunctionTable = 24,
        MTLArgumentTypePrimitiveAccelerationStructure = 25,
        MTLArgumentTypeInstanceAccelerationStructure = 26,
        MTLArgumentTypeIntersectionFunctionTable = 27,
    }
);

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum MTLBindingAccess {
        MTLBindingAccessReadOnly = 0,
        MTLBindingAccessReadWrite = 1,
        MTLBindingAccessWriteOnly = 2,
        #[deprecated]
        MTLArgumentAccessReadOnly = MTLBindingAccessReadOnly,
        #[deprecated]
        MTLArgumentAccessReadWrite = MTLBindingAccessReadWrite,
        #[deprecated]
        MTLArgumentAccessWriteOnly = MTLBindingAccessWriteOnly,
    }
);

pub type MTLArgumentAccess = MTLBindingAccess;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLType")]
    pub struct MTLType;

    #[cfg(feature = "Metal_MTLType")]
    unsafe impl ClassType for MTLType {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLType")]
unsafe impl NSObjectProtocol for MTLType {}

extern_methods!(
    #[cfg(feature = "Metal_MTLType")]
    unsafe impl MTLType {
        #[method(dataType)]
        pub unsafe fn dataType(&self) -> MTLDataType;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLType")]
    unsafe impl MTLType {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLStructMember")]
    pub struct MTLStructMember;

    #[cfg(feature = "Metal_MTLStructMember")]
    unsafe impl ClassType for MTLStructMember {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLStructMember")]
unsafe impl NSObjectProtocol for MTLStructMember {}

extern_methods!(
    #[cfg(feature = "Metal_MTLStructMember")]
    unsafe impl MTLStructMember {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub fn name(&self) -> Id<NSString>;

        #[method(offset)]
        pub fn offset(&self) -> NSUInteger;

        #[method(dataType)]
        pub fn dataType(&self) -> MTLDataType;

        #[cfg(feature = "Metal_MTLStructType")]
        #[method_id(@__retain_semantics Other structType)]
        pub fn structType(&self) -> Option<Id<MTLStructType>>;

        #[cfg(feature = "Metal_MTLArrayType")]
        #[method_id(@__retain_semantics Other arrayType)]
        pub fn arrayType(&self) -> Option<Id<MTLArrayType>>;

        #[cfg(feature = "Metal_MTLTextureReferenceType")]
        #[method_id(@__retain_semantics Other textureReferenceType)]
        pub unsafe fn textureReferenceType(&self) -> Option<Id<MTLTextureReferenceType>>;

        #[cfg(feature = "Metal_MTLPointerType")]
        #[method_id(@__retain_semantics Other pointerType)]
        pub unsafe fn pointerType(&self) -> Option<Id<MTLPointerType>>;

        #[method(argumentIndex)]
        pub unsafe fn argumentIndex(&self) -> NSUInteger;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLStructMember")]
    unsafe impl MTLStructMember {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLStructType")]
    pub struct MTLStructType;

    #[cfg(feature = "Metal_MTLStructType")]
    unsafe impl ClassType for MTLStructType {
        #[inherits(NSObject)]
        type Super = MTLType;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLStructType")]
unsafe impl NSObjectProtocol for MTLStructType {}

extern_methods!(
    #[cfg(feature = "Metal_MTLStructType")]
    unsafe impl MTLStructType {
        #[cfg(all(feature = "Foundation_NSArray", feature = "Metal_MTLStructMember"))]
        #[method_id(@__retain_semantics Other members)]
        pub fn members(&self) -> Id<NSArray<MTLStructMember>>;

        #[cfg(all(feature = "Foundation_NSString", feature = "Metal_MTLStructMember"))]
        #[method_id(@__retain_semantics Other memberByName:)]
        pub fn memberByName(&self, name: &NSString) -> Option<Id<MTLStructMember>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLStructType")]
    unsafe impl MTLStructType {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLArrayType")]
    pub struct MTLArrayType;

    #[cfg(feature = "Metal_MTLArrayType")]
    unsafe impl ClassType for MTLArrayType {
        #[inherits(NSObject)]
        type Super = MTLType;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLArrayType")]
unsafe impl NSObjectProtocol for MTLArrayType {}

extern_methods!(
    #[cfg(feature = "Metal_MTLArrayType")]
    unsafe impl MTLArrayType {
        #[method(elementType)]
        pub fn elementType(&self) -> MTLDataType;

        #[method(arrayLength)]
        pub fn arrayLength(&self) -> NSUInteger;

        #[method(stride)]
        pub fn stride(&self) -> NSUInteger;

        #[method(argumentIndexStride)]
        pub unsafe fn argumentIndexStride(&self) -> NSUInteger;

        #[cfg(feature = "Metal_MTLStructType")]
        #[method_id(@__retain_semantics Other elementStructType)]
        pub fn elementStructType(&self) -> Option<Id<MTLStructType>>;

        #[method_id(@__retain_semantics Other elementArrayType)]
        pub fn elementArrayType(&self) -> Option<Id<MTLArrayType>>;

        #[cfg(feature = "Metal_MTLTextureReferenceType")]
        #[method_id(@__retain_semantics Other elementTextureReferenceType)]
        pub unsafe fn elementTextureReferenceType(&self) -> Option<Id<MTLTextureReferenceType>>;

        #[cfg(feature = "Metal_MTLPointerType")]
        #[method_id(@__retain_semantics Other elementPointerType)]
        pub unsafe fn elementPointerType(&self) -> Option<Id<MTLPointerType>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLArrayType")]
    unsafe impl MTLArrayType {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLPointerType")]
    pub struct MTLPointerType;

    #[cfg(feature = "Metal_MTLPointerType")]
    unsafe impl ClassType for MTLPointerType {
        #[inherits(NSObject)]
        type Super = MTLType;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLPointerType")]
unsafe impl NSObjectProtocol for MTLPointerType {}

extern_methods!(
    #[cfg(feature = "Metal_MTLPointerType")]
    unsafe impl MTLPointerType {
        #[method(elementType)]
        pub unsafe fn elementType(&self) -> MTLDataType;

        #[method(access)]
        pub unsafe fn access(&self) -> MTLBindingAccess;

        #[method(alignment)]
        pub unsafe fn alignment(&self) -> NSUInteger;

        #[method(dataSize)]
        pub unsafe fn dataSize(&self) -> NSUInteger;

        #[method(elementIsArgumentBuffer)]
        pub unsafe fn elementIsArgumentBuffer(&self) -> bool;

        #[cfg(feature = "Metal_MTLStructType")]
        #[method_id(@__retain_semantics Other elementStructType)]
        pub unsafe fn elementStructType(&self) -> Option<Id<MTLStructType>>;

        #[cfg(feature = "Metal_MTLArrayType")]
        #[method_id(@__retain_semantics Other elementArrayType)]
        pub unsafe fn elementArrayType(&self) -> Option<Id<MTLArrayType>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLPointerType")]
    unsafe impl MTLPointerType {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLTextureReferenceType")]
    pub struct MTLTextureReferenceType;

    #[cfg(feature = "Metal_MTLTextureReferenceType")]
    unsafe impl ClassType for MTLTextureReferenceType {
        #[inherits(NSObject)]
        type Super = MTLType;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLTextureReferenceType")]
unsafe impl NSObjectProtocol for MTLTextureReferenceType {}

extern_methods!(
    #[cfg(feature = "Metal_MTLTextureReferenceType")]
    unsafe impl MTLTextureReferenceType {
        #[method(textureDataType)]
        pub unsafe fn textureDataType(&self) -> MTLDataType;

        #[method(textureType)]
        pub unsafe fn textureType(&self) -> MTLTextureType;

        #[method(access)]
        pub unsafe fn access(&self) -> MTLBindingAccess;

        #[method(isDepthTexture)]
        pub unsafe fn isDepthTexture(&self) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLTextureReferenceType")]
    unsafe impl MTLTextureReferenceType {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Metal_MTLArgument")]
    #[deprecated]
    pub struct MTLArgument;

    #[cfg(feature = "Metal_MTLArgument")]
    unsafe impl ClassType for MTLArgument {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Metal_MTLArgument")]
unsafe impl NSObjectProtocol for MTLArgument {}

extern_methods!(
    #[cfg(feature = "Metal_MTLArgument")]
    unsafe impl MTLArgument {
        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other name)]
        pub fn name(&self) -> Id<NSString>;

        #[deprecated]
        #[method(type)]
        pub unsafe fn r#type(&self) -> MTLArgumentType;

        #[deprecated]
        #[method(access)]
        pub fn access(&self) -> MTLBindingAccess;

        #[deprecated]
        #[method(index)]
        pub fn index(&self) -> NSUInteger;

        #[deprecated]
        #[method(isActive)]
        pub fn isActive(&self) -> bool;

        #[deprecated]
        #[method(bufferAlignment)]
        pub fn bufferAlignment(&self) -> NSUInteger;

        #[deprecated]
        #[method(bufferDataSize)]
        pub fn bufferDataSize(&self) -> NSUInteger;

        #[deprecated]
        #[method(bufferDataType)]
        pub fn bufferDataType(&self) -> MTLDataType;

        #[cfg(feature = "Metal_MTLStructType")]
        #[deprecated]
        #[method_id(@__retain_semantics Other bufferStructType)]
        pub fn bufferStructType(&self) -> Option<Id<MTLStructType>>;

        #[cfg(feature = "Metal_MTLPointerType")]
        #[method_id(@__retain_semantics Other bufferPointerType)]
        pub unsafe fn bufferPointerType(&self) -> Option<Id<MTLPointerType>>;

        #[deprecated]
        #[method(threadgroupMemoryAlignment)]
        pub fn threadgroupMemoryAlignment(&self) -> NSUInteger;

        #[deprecated]
        #[method(threadgroupMemoryDataSize)]
        pub fn threadgroupMemoryDataSize(&self) -> NSUInteger;

        #[deprecated]
        #[method(textureType)]
        pub fn textureType(&self) -> MTLTextureType;

        #[deprecated]
        #[method(textureDataType)]
        pub fn textureDataType(&self) -> MTLDataType;

        #[method(isDepthTexture)]
        pub unsafe fn isDepthTexture(&self) -> bool;

        #[method(arrayLength)]
        pub unsafe fn arrayLength(&self) -> NSUInteger;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Metal_MTLArgument")]
    unsafe impl MTLArgument {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_protocol!(
    pub unsafe trait MTLBinding: NSObjectProtocol {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        unsafe fn name(&self) -> Id<NSString>;

        #[method(type)]
        unsafe fn r#type(&self) -> MTLBindingType;

        #[method(access)]
        unsafe fn access(&self) -> MTLBindingAccess;

        #[method(index)]
        unsafe fn index(&self) -> NSUInteger;

        #[method(isUsed)]
        unsafe fn isUsed(&self) -> bool;

        #[method(isArgument)]
        unsafe fn isArgument(&self) -> bool;
    }

    unsafe impl ProtocolType for dyn MTLBinding {}
);

extern_protocol!(
    pub unsafe trait MTLBufferBinding: MTLBinding {
        #[method(bufferAlignment)]
        unsafe fn bufferAlignment(&self) -> NSUInteger;

        #[method(bufferDataSize)]
        unsafe fn bufferDataSize(&self) -> NSUInteger;

        #[method(bufferDataType)]
        unsafe fn bufferDataType(&self) -> MTLDataType;

        #[cfg(feature = "Metal_MTLStructType")]
        #[method_id(@__retain_semantics Other bufferStructType)]
        unsafe fn bufferStructType(&self) -> Option<Id<MTLStructType>>;

        #[cfg(feature = "Metal_MTLPointerType")]
        #[method_id(@__retain_semantics Other bufferPointerType)]
        unsafe fn bufferPointerType(&self) -> Option<Id<MTLPointerType>>;
    }

    unsafe impl ProtocolType for dyn MTLBufferBinding {}
);

extern_protocol!(
    pub unsafe trait MTLThreadgroupBinding: MTLBinding {
        #[method(threadgroupMemoryAlignment)]
        unsafe fn threadgroupMemoryAlignment(&self) -> NSUInteger;

        #[method(threadgroupMemoryDataSize)]
        unsafe fn threadgroupMemoryDataSize(&self) -> NSUInteger;
    }

    unsafe impl ProtocolType for dyn MTLThreadgroupBinding {}
);

extern_protocol!(
    pub unsafe trait MTLTextureBinding: MTLBinding {
        #[method(textureType)]
        unsafe fn textureType(&self) -> MTLTextureType;

        #[method(textureDataType)]
        unsafe fn textureDataType(&self) -> MTLDataType;

        #[method(isDepthTexture)]
        unsafe fn isDepthTexture(&self) -> bool;

        #[method(arrayLength)]
        unsafe fn arrayLength(&self) -> NSUInteger;
    }

    unsafe impl ProtocolType for dyn MTLTextureBinding {}
);

extern_protocol!(
    pub unsafe trait MTLObjectPayloadBinding: MTLBinding {
        #[method(objectPayloadAlignment)]
        unsafe fn objectPayloadAlignment(&self) -> NSUInteger;

        #[method(objectPayloadDataSize)]
        unsafe fn objectPayloadDataSize(&self) -> NSUInteger;
    }

    unsafe impl ProtocolType for dyn MTLObjectPayloadBinding {}
);