objc2-metal 0.3.2

Bindings to the Metal framework
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlautoreleasedrenderpipelinereflection?language=objc)
#[cfg(feature = "MTLRenderPipeline")]
pub type MTLAutoreleasedRenderPipelineReflection = MTLRenderPipelineReflection;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlautoreleasedcomputepipelinereflection?language=objc)
#[cfg(feature = "MTLComputePipeline")]
pub type MTLAutoreleasedComputePipelineReflection = MTLComputePipelineReflection;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewlibrarycompletionhandler?language=objc)
#[cfg(feature = "block2")]
pub type MTLNewLibraryCompletionHandler =
    *mut block2::DynBlock<dyn Fn(*mut ProtocolObject<dyn MTLLibrary>, *mut NSError)>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewrenderpipelinestatecompletionhandler?language=objc)
#[cfg(all(
    feature = "MTLAllocation",
    feature = "MTLRenderPipeline",
    feature = "block2"
))]
pub type MTLNewRenderPipelineStateCompletionHandler =
    *mut block2::DynBlock<dyn Fn(*mut ProtocolObject<dyn MTLRenderPipelineState>, *mut NSError)>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewrenderpipelinestatewithreflectioncompletionhandler?language=objc)
#[cfg(all(
    feature = "MTLAllocation",
    feature = "MTLRenderPipeline",
    feature = "block2"
))]
pub type MTLNewRenderPipelineStateWithReflectionCompletionHandler = *mut block2::DynBlock<
    dyn Fn(
        *mut ProtocolObject<dyn MTLRenderPipelineState>,
        *mut MTLRenderPipelineReflection,
        *mut NSError,
    ),
>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewcomputepipelinestatecompletionhandler?language=objc)
#[cfg(all(
    feature = "MTLAllocation",
    feature = "MTLComputePipeline",
    feature = "block2"
))]
pub type MTLNewComputePipelineStateCompletionHandler =
    *mut block2::DynBlock<dyn Fn(*mut ProtocolObject<dyn MTLComputePipelineState>, *mut NSError)>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewcomputepipelinestatewithreflectioncompletionhandler?language=objc)
#[cfg(all(
    feature = "MTLAllocation",
    feature = "MTLComputePipeline",
    feature = "block2"
))]
pub type MTLNewComputePipelineStateWithReflectionCompletionHandler = *mut block2::DynBlock<
    dyn Fn(
        *mut ProtocolObject<dyn MTLComputePipelineState>,
        *mut MTLComputePipelineReflection,
        *mut NSError,
    ),
>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlnewdynamiclibrarycompletionhandler?language=objc)
#[cfg(all(feature = "MTLDynamicLibrary", feature = "block2"))]
pub type MTLNewDynamicLibraryCompletionHandler =
    *mut block2::DynBlock<dyn Fn(*mut ProtocolObject<dyn MTLDynamicLibrary>, *mut NSError)>;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlautoreleasedargument?language=objc)
#[deprecated = "Use MTLBinding and cast to specific Binding (MTLTextureBinding, MTLBufferBinding, .etc) instead"]
#[cfg(feature = "MTLArgument")]
pub type MTLAutoreleasedArgument = MTLArgument;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlpatchtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLPatchType(pub NSUInteger);
impl MTLPatchType {
    #[doc(alias = "MTLPatchTypeNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "MTLPatchTypeTriangle")]
    pub const Triangle: Self = Self(1);
    #[doc(alias = "MTLPatchTypeQuad")]
    pub const Quad: Self = Self(2);
}

unsafe impl Encode for MTLPatchType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLPatchType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlvertexattribute?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLVertexAttribute;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MTLVertexAttribute {}
);

impl MTLVertexAttribute {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub fn name(&self) -> Retained<NSString>;

        #[unsafe(method(attributeIndex))]
        #[unsafe(method_family = none)]
        pub fn attributeIndex(&self) -> NSUInteger;

        #[cfg(feature = "MTLDataType")]
        #[unsafe(method(attributeType))]
        #[unsafe(method_family = none)]
        pub fn attributeType(&self) -> MTLDataType;

        #[unsafe(method(isActive))]
        #[unsafe(method_family = none)]
        pub fn isActive(&self) -> bool;

        #[unsafe(method(isPatchData))]
        #[unsafe(method_family = none)]
        pub fn isPatchData(&self) -> bool;

        #[unsafe(method(isPatchControlPointData))]
        #[unsafe(method_family = none)]
        pub fn isPatchControlPointData(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLVertexAttribute {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLVertexAttribute {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlattribute?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLAttribute;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MTLAttribute {}
);

impl MTLAttribute {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub fn name(&self) -> Retained<NSString>;

        #[unsafe(method(attributeIndex))]
        #[unsafe(method_family = none)]
        pub fn attributeIndex(&self) -> NSUInteger;

        #[cfg(feature = "MTLDataType")]
        #[unsafe(method(attributeType))]
        #[unsafe(method_family = none)]
        pub fn attributeType(&self) -> MTLDataType;

        #[unsafe(method(isActive))]
        #[unsafe(method_family = none)]
        pub fn isActive(&self) -> bool;

        #[unsafe(method(isPatchData))]
        #[unsafe(method_family = none)]
        pub fn isPatchData(&self) -> bool;

        #[unsafe(method(isPatchControlPointData))]
        #[unsafe(method_family = none)]
        pub fn isPatchControlPointData(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLAttribute {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLAttribute {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// An identifier for a top-level Metal function.
///
/// Each location in the API where a program is used requires a function written for that specific usage.
///
///
/// A vertex shader, usable for a MTLRenderPipelineState.
///
///
/// A fragment shader, usable for a MTLRenderPipelineState.
///
///
/// A compute kernel, usable to create a MTLComputePipelineState.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctiontype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLFunctionType(pub NSUInteger);
impl MTLFunctionType {
    #[doc(alias = "MTLFunctionTypeVertex")]
    pub const Vertex: Self = Self(1);
    #[doc(alias = "MTLFunctionTypeFragment")]
    pub const Fragment: Self = Self(2);
    #[doc(alias = "MTLFunctionTypeKernel")]
    pub const Kernel: Self = Self(3);
    #[doc(alias = "MTLFunctionTypeVisible")]
    pub const Visible: Self = Self(5);
    #[doc(alias = "MTLFunctionTypeIntersection")]
    pub const Intersection: Self = Self(6);
    #[doc(alias = "MTLFunctionTypeMesh")]
    pub const Mesh: Self = Self(7);
    #[doc(alias = "MTLFunctionTypeObject")]
    pub const Object: Self = Self(8);
}

unsafe impl Encode for MTLFunctionType {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLFunctionType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// describe an uberShader constant used by the function
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionconstant?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLFunctionConstant;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MTLFunctionConstant {}
);

impl MTLFunctionConstant {
    extern_methods!(
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub fn name(&self) -> Retained<NSString>;

        #[cfg(feature = "MTLDataType")]
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub fn r#type(&self) -> MTLDataType;

        #[unsafe(method(index))]
        #[unsafe(method_family = none)]
        pub fn index(&self) -> NSUInteger;

        #[unsafe(method(required))]
        #[unsafe(method_family = none)]
        pub fn required(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLFunctionConstant {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLFunctionConstant {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_protocol!(
    /// A handle to intermediate code used as inputs for either a MTLComputePipelineState or a MTLRenderPipelineState.
    ///
    /// MTLFunction is a single vertex shader, fragment shader, or compute function.  A Function can only be used with the device that it was created against.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunction?language=objc)
    pub unsafe trait MTLFunction: NSObjectProtocol + Send + Sync {
        /// A string to help identify this object.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        fn label(&self) -> Option<Retained<NSString>>;

        /// Setter for [`label`][Self::label].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLabel:))]
        #[unsafe(method_family = none)]
        fn setLabel(&self, label: Option<&NSString>);

        #[cfg(feature = "MTLDevice")]
        /// The device this resource was created against.  This resource can only be used with this device.
        #[unsafe(method(device))]
        #[unsafe(method_family = none)]
        fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;

        /// The overall kind of entry point: compute, vertex, or fragment.
        #[unsafe(method(functionType))]
        #[unsafe(method_family = none)]
        fn functionType(&self) -> MTLFunctionType;

        /// Returns the patch type. MTLPatchTypeNone if it is not a post tessellation vertex shader.
        #[unsafe(method(patchType))]
        #[unsafe(method_family = none)]
        fn patchType(&self) -> MTLPatchType;

        /// Returns the number of patch control points if it was specified in the shader. Returns -1 if it
        /// was not specified.
        #[unsafe(method(patchControlPointCount))]
        #[unsafe(method_family = none)]
        fn patchControlPointCount(&self) -> NSInteger;

        #[unsafe(method(vertexAttributes))]
        #[unsafe(method_family = none)]
        fn vertexAttributes(&self) -> Option<Retained<NSArray<MTLVertexAttribute>>>;

        /// Returns an array describing the attributes
        #[unsafe(method(stageInputAttributes))]
        #[unsafe(method_family = none)]
        fn stageInputAttributes(&self) -> Option<Retained<NSArray<MTLAttribute>>>;

        /// The name of the function in the shading language.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        fn name(&self) -> Retained<NSString>;

        /// A dictionary containing information about all function contents, keyed by the constant names.
        #[unsafe(method(functionConstantsDictionary))]
        #[unsafe(method_family = none)]
        fn functionConstantsDictionary(
            &self,
        ) -> Retained<NSDictionary<NSString, MTLFunctionConstant>>;

        #[cfg(feature = "MTLArgumentEncoder")]
        /// Creates an argument encoder which will encode arguments matching the layout of the argument buffer at the given bind point index.
        ///
        /// # Safety
        ///
        /// `bufferIndex` might not be bounds-checked.
        #[unsafe(method(newArgumentEncoderWithBufferIndex:))]
        #[unsafe(method_family = new)]
        unsafe fn newArgumentEncoderWithBufferIndex(
            &self,
            buffer_index: NSUInteger,
        ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>;

        #[cfg(all(feature = "MTLArgument", feature = "MTLArgumentEncoder"))]
        /// Creates an argument encoder which will encode arguments matching the layout of the argument buffer at the given bind point index.
        ///
        /// # Safety
        ///
        /// `bufferIndex` might not be bounds-checked.
        #[deprecated = "Use MTLDevice's newArgumentEncoderWithBufferBinding: instead"]
        #[unsafe(method(newArgumentEncoderWithBufferIndex:reflection:))]
        #[unsafe(method_family = new)]
        unsafe fn newArgumentEncoderWithBufferIndex_reflection(
            &self,
            buffer_index: NSUInteger,
            reflection: Option<&mut Option<Retained<MTLAutoreleasedArgument>>>,
        ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>;

        #[cfg(feature = "MTLFunctionDescriptor")]
        /// The options this function was created with.
        #[unsafe(method(options))]
        #[unsafe(method_family = none)]
        fn options(&self) -> MTLFunctionOptions;
    }
);

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtllanguageversion?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLLanguageVersion(pub NSUInteger);
impl MTLLanguageVersion {
    #[doc(alias = "MTLLanguageVersion1_0")]
    #[deprecated = "Use a newer language standard"]
    pub const Version1_0: Self = Self(1 << 16);
    #[doc(alias = "MTLLanguageVersion1_1")]
    pub const Version1_1: Self = Self((1 << 16) + 1);
    #[doc(alias = "MTLLanguageVersion1_2")]
    pub const Version1_2: Self = Self((1 << 16) + 2);
    #[doc(alias = "MTLLanguageVersion2_0")]
    pub const Version2_0: Self = Self(2 << 16);
    #[doc(alias = "MTLLanguageVersion2_1")]
    pub const Version2_1: Self = Self((2 << 16) + 1);
    #[doc(alias = "MTLLanguageVersion2_2")]
    pub const Version2_2: Self = Self((2 << 16) + 2);
    #[doc(alias = "MTLLanguageVersion2_3")]
    pub const Version2_3: Self = Self((2 << 16) + 3);
    #[doc(alias = "MTLLanguageVersion2_4")]
    pub const Version2_4: Self = Self((2 << 16) + 4);
    #[doc(alias = "MTLLanguageVersion3_0")]
    pub const Version3_0: Self = Self((3 << 16) + 0);
    #[doc(alias = "MTLLanguageVersion3_1")]
    pub const Version3_1: Self = Self((3 << 16) + 1);
    #[doc(alias = "MTLLanguageVersion3_2")]
    pub const Version3_2: Self = Self((3 << 16) + 2);
    #[doc(alias = "MTLLanguageVersion4_0")]
    pub const Version4_0: Self = Self((4 << 16) + 0);
}

unsafe impl Encode for MTLLanguageVersion {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLLanguageVersion {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtllibrarytype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLLibraryType(pub NSInteger);
impl MTLLibraryType {
    #[doc(alias = "MTLLibraryTypeExecutable")]
    pub const Executable: Self = Self(0);
    #[doc(alias = "MTLLibraryTypeDynamic")]
    pub const Dynamic: Self = Self(1);
}

unsafe impl Encode for MTLLibraryType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MTLLibraryType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// Optimization level for the Metal compiler.
///
///
/// Optimize for program performance.
///
///
/// Like default, with extra optimizations to reduce code size.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtllibraryoptimizationlevel?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLLibraryOptimizationLevel(pub NSInteger);
impl MTLLibraryOptimizationLevel {
    #[doc(alias = "MTLLibraryOptimizationLevelDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "MTLLibraryOptimizationLevelSize")]
    pub const Size: Self = Self(1);
}

unsafe impl Encode for MTLLibraryOptimizationLevel {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MTLLibraryOptimizationLevel {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcompilesymbolvisibility?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLCompileSymbolVisibility(pub NSInteger);
impl MTLCompileSymbolVisibility {
    #[doc(alias = "MTLCompileSymbolVisibilityDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "MTLCompileSymbolVisibilityHidden")]
    pub const Hidden: Self = Self(1);
}

unsafe impl Encode for MTLCompileSymbolVisibility {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MTLCompileSymbolVisibility {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// An enum to indicate if the compiler can perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard
///
///
/// Disables unsafe floating-point optimizations
///
///
/// Allows aggressive, unsafe floating-point optimizations but preserves infs and nans
///
///
/// Allows aggressive, unsafe floating-point optimizations
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmathmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLMathMode(pub NSInteger);
impl MTLMathMode {
    #[doc(alias = "MTLMathModeSafe")]
    pub const Safe: Self = Self(0);
    #[doc(alias = "MTLMathModeRelaxed")]
    pub const Relaxed: Self = Self(1);
    #[doc(alias = "MTLMathModeFast")]
    pub const Fast: Self = Self(2);
}

unsafe impl Encode for MTLMathMode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MTLMathMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// An enum to indicate the default math functions for single precision floating-point
///
///
/// Sets the default math functions for single precision floating-point to the corresponding functions in `metal::fast` namespace
///
///
/// Sets the default math functions for single precision floating-point to the corresponding functions in 'metal::precise' namespace
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlmathfloatingpointfunctions?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLMathFloatingPointFunctions(pub NSInteger);
impl MTLMathFloatingPointFunctions {
    #[doc(alias = "MTLMathFloatingPointFunctionsFast")]
    pub const Fast: Self = Self(0);
    #[doc(alias = "MTLMathFloatingPointFunctionsPrecise")]
    pub const Precise: Self = Self(1);
}

unsafe impl Encode for MTLMathFloatingPointFunctions {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MTLMathFloatingPointFunctions {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcompileoptions?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLCompileOptions;
);

extern_conformance!(
    unsafe impl NSCopying for MTLCompileOptions {}
);

unsafe impl CopyingHelper for MTLCompileOptions {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MTLCompileOptions {}
);

impl MTLCompileOptions {
    extern_methods!(
        /// List of preprocessor macros to consider to when compiling this program. Specified as key value pairs, using a NSDictionary. The keys must be NSString objects and values can be either NSString or NSNumber objects.
        ///
        /// The default value is nil.
        #[unsafe(method(preprocessorMacros))]
        #[unsafe(method_family = none)]
        pub fn preprocessorMacros(&self) -> Option<Retained<NSDictionary<NSString, NSObject>>>;

        /// Setter for [`preprocessorMacros`][Self::preprocessorMacros].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `preprocessor_macros` generic should be of the correct type.
        #[unsafe(method(setPreprocessorMacros:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPreprocessorMacros(
            &self,
            preprocessor_macros: Option<&NSDictionary<NSString, NSObject>>,
        );

        /// If YES, enables the compiler to perform optimizations for floating-point arithmetic that may violate the IEEE 754 standard. It also enables the high precision variant of math functions for single precision floating-point scalar and vector types. fastMathEnabled defaults to YES.
        #[deprecated = "Use mathMode instead"]
        #[unsafe(method(fastMathEnabled))]
        #[unsafe(method_family = none)]
        pub fn fastMathEnabled(&self) -> bool;

        /// Setter for [`fastMathEnabled`][Self::fastMathEnabled].
        #[deprecated = "Use mathMode instead"]
        #[unsafe(method(setFastMathEnabled:))]
        #[unsafe(method_family = none)]
        pub fn setFastMathEnabled(&self, fast_math_enabled: bool);

        /// Sets the floating-point arithmetic optimizations. Default depends on the language standard version.
        #[unsafe(method(mathMode))]
        #[unsafe(method_family = none)]
        pub fn mathMode(&self) -> MTLMathMode;

        /// Setter for [`mathMode`][Self::mathMode].
        #[unsafe(method(setMathMode:))]
        #[unsafe(method_family = none)]
        pub fn setMathMode(&self, math_mode: MTLMathMode);

        /// Sets the default math functions for single precision floating-point. Default is `MTLMathFloatingPointFunctionsFast`.
        #[unsafe(method(mathFloatingPointFunctions))]
        #[unsafe(method_family = none)]
        pub fn mathFloatingPointFunctions(&self) -> MTLMathFloatingPointFunctions;

        /// Setter for [`mathFloatingPointFunctions`][Self::mathFloatingPointFunctions].
        #[unsafe(method(setMathFloatingPointFunctions:))]
        #[unsafe(method_family = none)]
        pub fn setMathFloatingPointFunctions(
            &self,
            math_floating_point_functions: MTLMathFloatingPointFunctions,
        );

        /// set the metal language version used to interpret the source.
        #[unsafe(method(languageVersion))]
        #[unsafe(method_family = none)]
        pub fn languageVersion(&self) -> MTLLanguageVersion;

        /// Setter for [`languageVersion`][Self::languageVersion].
        #[unsafe(method(setLanguageVersion:))]
        #[unsafe(method_family = none)]
        pub fn setLanguageVersion(&self, language_version: MTLLanguageVersion);

        /// Which type the library should be compiled as. The default value is MTLLibraryTypeExecutable.
        ///
        /// MTLLibraryTypeExecutable is suitable to build a library of "kernel", "vertex" and "fragment" qualified functions.
        /// MTLLibraryType is suitable when the compilation result will instead be used to instantiate a MTLDynamicLibrary.
        /// MTLDynamicLibrary contains no qualified functions, but it's unqualified functions and variables can be used as an external dependency for compiling other libraries.
        #[unsafe(method(libraryType))]
        #[unsafe(method_family = none)]
        pub fn libraryType(&self) -> MTLLibraryType;

        /// Setter for [`libraryType`][Self::libraryType].
        #[unsafe(method(setLibraryType:))]
        #[unsafe(method_family = none)]
        pub fn setLibraryType(&self, library_type: MTLLibraryType);

        /// The install name of this dynamic library.
        ///
        /// The install name is used when a pipeline state is created that depends, directly or indirectly, on a dynamic library.
        /// The installName is embedded into any other MTLLibrary that links against the compilation result.
        /// This property should be set such that the dynamic library can be found in the file system at the time a pipeline state is created.
        /// Specify one of:
        /// - an absolute path to a file from which the dynamic library can be loaded, or
        /// - a path relative to
        /// @
        /// executable_path, where
        /// @
        /// executable_path is substituted with the directory name from which the MTLLibrary containing the MTLFunction entrypoint used to create the pipeline state is loaded, or
        /// - a path relative to
        /// @
        /// loader_path, where
        /// @
        /// loader_path is substituted with the directory name from which the MTLLibrary with the reference to this installName embedded is loaded.
        /// The first is appropriate for MTLDynamicLibrary written to the file-system using its serializeToURL:error: method on the current device.
        /// The others are appropriate when the MTLDynamicLibrary is installed as part of a bundle or app, where the absolute path is not known.
        /// This property is ignored when the type property is not set to MTLLibraryTypeDynamic.
        /// This propery should not be null if the property type is set to MTLLibraryTypeDynamic: the compilation will fail in that scenario.
        #[unsafe(method(installName))]
        #[unsafe(method_family = none)]
        pub fn installName(&self) -> Option<Retained<NSString>>;

        /// Setter for [`installName`][Self::installName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setInstallName:))]
        #[unsafe(method_family = none)]
        pub fn setInstallName(&self, install_name: Option<&NSString>);

        #[cfg(feature = "MTLDynamicLibrary")]
        /// A set of MTLDynamicLibrary instances to link against.
        /// The installName of the provided MTLDynamicLibrary is embedded into the compilation result.
        /// When a function from the resulting MTLLibrary is used (either as an MTLFunction, or as an to create a pipeline state, the embedded install names are used to automatically load the MTLDynamicLibrary instances.
        /// This property can be null if no libraries should be automatically loaded, either because the MTLLibrary has no external dependencies, or because you will use preloadedLibraries to specify the libraries to use at pipeline creation time.
        #[unsafe(method(libraries))]
        #[unsafe(method_family = none)]
        pub fn libraries(&self)
            -> Option<Retained<NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>>;

        #[cfg(feature = "MTLDynamicLibrary")]
        /// Setter for [`libraries`][Self::libraries].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLibraries:))]
        #[unsafe(method_family = none)]
        pub fn setLibraries(
            &self,
            libraries: Option<&NSArray<ProtocolObject<dyn MTLDynamicLibrary>>>,
        );

        /// If YES,  set the compiler to compile shaders to preserve invariance.  The default is false.
        #[unsafe(method(preserveInvariance))]
        #[unsafe(method_family = none)]
        pub fn preserveInvariance(&self) -> bool;

        /// Setter for [`preserveInvariance`][Self::preserveInvariance].
        #[unsafe(method(setPreserveInvariance:))]
        #[unsafe(method_family = none)]
        pub fn setPreserveInvariance(&self, preserve_invariance: bool);

        /// Sets the compiler optimization level.
        #[unsafe(method(optimizationLevel))]
        #[unsafe(method_family = none)]
        pub fn optimizationLevel(&self) -> MTLLibraryOptimizationLevel;

        /// Setter for [`optimizationLevel`][Self::optimizationLevel].
        #[unsafe(method(setOptimizationLevel:))]
        #[unsafe(method_family = none)]
        pub fn setOptimizationLevel(&self, optimization_level: MTLLibraryOptimizationLevel);

        /// Adds a compiler command to force the default visibility of symbols to be hidden
        #[unsafe(method(compileSymbolVisibility))]
        #[unsafe(method_family = none)]
        pub fn compileSymbolVisibility(&self) -> MTLCompileSymbolVisibility;

        /// Setter for [`compileSymbolVisibility`][Self::compileSymbolVisibility].
        #[unsafe(method(setCompileSymbolVisibility:))]
        #[unsafe(method_family = none)]
        pub fn setCompileSymbolVisibility(
            &self,
            compile_symbol_visibility: MTLCompileSymbolVisibility,
        );

        /// Adds a compiler command to allow the reference of undefined symbols
        #[unsafe(method(allowReferencingUndefinedSymbols))]
        #[unsafe(method_family = none)]
        pub fn allowReferencingUndefinedSymbols(&self) -> bool;

        /// Setter for [`allowReferencingUndefinedSymbols`][Self::allowReferencingUndefinedSymbols].
        #[unsafe(method(setAllowReferencingUndefinedSymbols:))]
        #[unsafe(method_family = none)]
        pub fn setAllowReferencingUndefinedSymbols(
            &self,
            allow_referencing_undefined_symbols: bool,
        );

        /// Adds a compiler command to specify the total threads per threadgroup
        #[unsafe(method(maxTotalThreadsPerThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn maxTotalThreadsPerThreadgroup(&self) -> NSUInteger;

        /// Setter for [`maxTotalThreadsPerThreadgroup`][Self::maxTotalThreadsPerThreadgroup].
        #[unsafe(method(setMaxTotalThreadsPerThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn setMaxTotalThreadsPerThreadgroup(
            &self,
            max_total_threads_per_threadgroup: NSUInteger,
        );

        #[cfg(feature = "MTLTypes")]
        /// Sets the required threads-per-threadgroup during dispatches. The `threadsPerThreadgroup` argument of any dispatch must match this value if it is set.
        /// Optional, unless the pipeline is going to use CooperativeTensors in which case this must be set.
        /// Setting this to a size of 0 in every dimension disables this property
        #[unsafe(method(requiredThreadsPerThreadgroup))]
        #[unsafe(method_family = none)]
        pub fn requiredThreadsPerThreadgroup(&self) -> MTLSize;

        #[cfg(feature = "MTLTypes")]
        /// Setter for [`requiredThreadsPerThreadgroup`][Self::requiredThreadsPerThreadgroup].
        #[unsafe(method(setRequiredThreadsPerThreadgroup:))]
        #[unsafe(method_family = none)]
        pub fn setRequiredThreadsPerThreadgroup(&self, required_threads_per_threadgroup: MTLSize);

        /// If YES,  set the compiler to enable any logging in the shader. The default is false.
        #[unsafe(method(enableLogging))]
        #[unsafe(method_family = none)]
        pub fn enableLogging(&self) -> bool;

        /// Setter for [`enableLogging`][Self::enableLogging].
        #[unsafe(method(setEnableLogging:))]
        #[unsafe(method_family = none)]
        pub fn setEnableLogging(&self, enable_logging: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLCompileOptions {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLCompileOptions {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_class!(
    /// Represents a reflection object containing information about a function in a Metal library.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionreflection?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTLFunctionReflection;
);

unsafe impl Send for MTLFunctionReflection {}

unsafe impl Sync for MTLFunctionReflection {}

extern_conformance!(
    unsafe impl NSObjectProtocol for MTLFunctionReflection {}
);

impl MTLFunctionReflection {
    extern_methods!(
        #[cfg(feature = "MTLArgument")]
        /// Provides a list of inputs and outputs of the function.
        #[unsafe(method(bindings))]
        #[unsafe(method_family = none)]
        pub fn bindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MTLFunctionReflection {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for MTLFunctionReflection {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// NSErrors raised when creating a library.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtllibraryerrordomain?language=objc)
    pub static MTLLibraryErrorDomain: &'static NSErrorDomain;
}

/// NSErrors raised when creating a library.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtllibraryerror?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLLibraryError(pub NSUInteger);
impl MTLLibraryError {
    #[doc(alias = "MTLLibraryErrorUnsupported")]
    pub const Unsupported: Self = Self(1);
    #[doc(alias = "MTLLibraryErrorInternal")]
    pub const Internal: Self = Self(2);
    #[doc(alias = "MTLLibraryErrorCompileFailure")]
    pub const CompileFailure: Self = Self(3);
    #[doc(alias = "MTLLibraryErrorCompileWarning")]
    pub const CompileWarning: Self = Self(4);
    #[doc(alias = "MTLLibraryErrorFunctionNotFound")]
    pub const FunctionNotFound: Self = Self(5);
    #[doc(alias = "MTLLibraryErrorFileNotFound")]
    pub const FileNotFound: Self = Self(6);
}

unsafe impl Encode for MTLLibraryError {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MTLLibraryError {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtllibrary?language=objc)
    pub unsafe trait MTLLibrary: NSObjectProtocol + Send + Sync {
        /// A string to help identify this object.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        fn label(&self) -> Option<Retained<NSString>>;

        /// Setter for [`label`][Self::label].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLabel:))]
        #[unsafe(method_family = none)]
        fn setLabel(&self, label: Option<&NSString>);

        #[cfg(feature = "MTLDevice")]
        /// The device this resource was created against.  This resource can only be used with this device.
        #[unsafe(method(device))]
        #[unsafe(method_family = none)]
        fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;

        /// Returns a pointer to a function object, return nil if the function is not found in the library.
        #[unsafe(method(newFunctionWithName:))]
        #[unsafe(method_family = new)]
        fn newFunctionWithName(
            &self,
            function_name: &NSString,
        ) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[cfg(feature = "MTLFunctionConstantValues")]
        /// Returns a pointer to a function object obtained by applying the constant values to the named function.
        ///
        /// This method will call the compiler. Use newFunctionWithName:constantValues:completionHandler: to
        /// avoid waiting on the compiler.
        #[unsafe(method(newFunctionWithName:constantValues:error:_))]
        #[unsafe(method_family = new)]
        fn newFunctionWithName_constantValues_error(
            &self,
            name: &NSString,
            constant_values: &MTLFunctionConstantValues,
        ) -> Result<Retained<ProtocolObject<dyn MTLFunction>>, Retained<NSError>>;

        #[cfg(all(feature = "MTLFunctionConstantValues", feature = "block2"))]
        /// Returns a pointer to a function object obtained by applying the constant values to the named function.
        ///
        /// This method is asynchronous since it is will call the compiler.
        #[unsafe(method(newFunctionWithName:constantValues:completionHandler:))]
        #[unsafe(method_family = none)]
        fn newFunctionWithName_constantValues_completionHandler(
            &self,
            name: &NSString,
            constant_values: &MTLFunctionConstantValues,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut ProtocolObject<dyn MTLFunction>, *mut NSError),
            >,
        );

        /// Returns a reflection object for a matching function name in this library instance.
        ///
        /// - Parameters:
        /// - functionName: The name of the function.
        ///
        /// - Returns: An object containing the reflection information, or `nil` if no function in the library matches the name.
        #[unsafe(method(reflectionForFunctionWithName:))]
        #[unsafe(method_family = none)]
        fn reflectionForFunctionWithName(
            &self,
            function_name: &NSString,
        ) -> Option<Retained<MTLFunctionReflection>>;

        #[cfg(all(feature = "MTLFunctionDescriptor", feature = "block2"))]
        /// Create a new MTLFunction object asynchronously.
        #[unsafe(method(newFunctionWithDescriptor:completionHandler:))]
        #[unsafe(method_family = none)]
        fn newFunctionWithDescriptor_completionHandler(
            &self,
            descriptor: &MTLFunctionDescriptor,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut ProtocolObject<dyn MTLFunction>, *mut NSError),
            >,
        );

        #[cfg(feature = "MTLFunctionDescriptor")]
        /// Create  a new MTLFunction object synchronously.
        #[unsafe(method(newFunctionWithDescriptor:error:_))]
        #[unsafe(method_family = new)]
        fn newFunctionWithDescriptor_error(
            &self,
            descriptor: &MTLFunctionDescriptor,
        ) -> Result<Retained<ProtocolObject<dyn MTLFunction>>, Retained<NSError>>;

        #[cfg(all(feature = "MTLFunctionDescriptor", feature = "block2"))]
        /// Create a new MTLFunction object asynchronously.
        #[unsafe(method(newIntersectionFunctionWithDescriptor:completionHandler:))]
        #[unsafe(method_family = none)]
        fn newIntersectionFunctionWithDescriptor_completionHandler(
            &self,
            descriptor: &MTLIntersectionFunctionDescriptor,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut ProtocolObject<dyn MTLFunction>, *mut NSError),
            >,
        );

        #[cfg(feature = "MTLFunctionDescriptor")]
        /// Create  a new MTLFunction object synchronously.
        #[unsafe(method(newIntersectionFunctionWithDescriptor:error:_))]
        #[unsafe(method_family = new)]
        fn newIntersectionFunctionWithDescriptor_error(
            &self,
            descriptor: &MTLIntersectionFunctionDescriptor,
        ) -> Result<Retained<ProtocolObject<dyn MTLFunction>>, Retained<NSError>>;

        /// The array contains NSString objects, with the name of each function in library.
        #[unsafe(method(functionNames))]
        #[unsafe(method_family = none)]
        fn functionNames(&self) -> Retained<NSArray<NSString>>;

        /// The library type provided when this MTLLibrary was created.
        /// Libraries with MTLLibraryTypeExecutable can be used to obtain MTLFunction from.
        /// Libraries with MTLLibraryTypeDynamic can be used to resolve external references in other MTLLibrary from.
        ///
        /// See: MTLCompileOptions
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        fn r#type(&self) -> MTLLibraryType;

        /// The installName provided when this MTLLibrary was created.
        ///
        /// Always nil if the type of the library is not MTLLibraryTypeDynamic.
        ///
        /// See: MTLCompileOptions
        #[unsafe(method(installName))]
        #[unsafe(method_family = none)]
        fn installName(&self) -> Option<Retained<NSString>>;
    }
);