objc2_metal/generated/
MTLLinkedFunctions.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A class to set functions to be linked.
12    ///
13    /// All functions set on this object must have unique names.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtllinkedfunctions?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct MTLLinkedFunctions;
19);
20
21extern_conformance!(
22    unsafe impl NSCopying for MTLLinkedFunctions {}
23);
24
25unsafe impl CopyingHelper for MTLLinkedFunctions {
26    type Result = Self;
27}
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for MTLLinkedFunctions {}
31);
32
33impl MTLLinkedFunctions {
34    extern_methods!(
35        /// Create an autoreleased MTLLinkedFunctions object.
36        #[unsafe(method(linkedFunctions))]
37        #[unsafe(method_family = none)]
38        pub fn linkedFunctions() -> Retained<MTLLinkedFunctions>;
39
40        #[cfg(feature = "MTLLibrary")]
41        /// The array of functions to be AIR linked.
42        #[unsafe(method(functions))]
43        #[unsafe(method_family = none)]
44        pub fn functions(&self) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
45
46        #[cfg(feature = "MTLLibrary")]
47        /// Setter for [`functions`][Self::functions].
48        ///
49        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
50        #[unsafe(method(setFunctions:))]
51        #[unsafe(method_family = none)]
52        pub fn setFunctions(&self, functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>);
53
54        #[cfg(feature = "MTLLibrary")]
55        /// The array of functions compiled to binary to be linked.
56        #[unsafe(method(binaryFunctions))]
57        #[unsafe(method_family = none)]
58        pub fn binaryFunctions(&self)
59            -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
60
61        #[cfg(feature = "MTLLibrary")]
62        /// Setter for [`binaryFunctions`][Self::binaryFunctions].
63        ///
64        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
65        #[unsafe(method(setBinaryFunctions:))]
66        #[unsafe(method_family = none)]
67        pub fn setBinaryFunctions(
68            &self,
69            binary_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
70        );
71
72        #[cfg(feature = "MTLLibrary")]
73        /// Groups of functions, grouped to match callsites in the shader code.
74        #[unsafe(method(groups))]
75        #[unsafe(method_family = none)]
76        pub fn groups(
77            &self,
78        ) -> Option<Retained<NSDictionary<NSString, NSArray<ProtocolObject<dyn MTLFunction>>>>>;
79
80        #[cfg(feature = "MTLLibrary")]
81        /// Setter for [`groups`][Self::groups].
82        ///
83        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
84        #[unsafe(method(setGroups:))]
85        #[unsafe(method_family = none)]
86        pub fn setGroups(
87            &self,
88            groups: Option<&NSDictionary<NSString, NSArray<ProtocolObject<dyn MTLFunction>>>>,
89        );
90
91        #[cfg(feature = "MTLLibrary")]
92        /// The array of functions to be AIR linked.
93        ///
94        /// These functions are not exported by the pipeline state as MTLFunctionHandle objects.
95        /// Function pointer support is not required to link private functions.
96        #[unsafe(method(privateFunctions))]
97        #[unsafe(method_family = none)]
98        pub fn privateFunctions(
99            &self,
100        ) -> Option<Retained<NSArray<ProtocolObject<dyn MTLFunction>>>>;
101
102        #[cfg(feature = "MTLLibrary")]
103        /// Setter for [`privateFunctions`][Self::privateFunctions].
104        ///
105        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
106        #[unsafe(method(setPrivateFunctions:))]
107        #[unsafe(method_family = none)]
108        pub fn setPrivateFunctions(
109            &self,
110            private_functions: Option<&NSArray<ProtocolObject<dyn MTLFunction>>>,
111        );
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116impl MTLLinkedFunctions {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub fn init(this: Allocated<Self>) -> Retained<Self>;
121
122        #[unsafe(method(new))]
123        #[unsafe(method_family = new)]
124        pub fn new() -> Retained<Self>;
125    );
126}
127
128impl DefaultRetained for MTLLinkedFunctions {
129    #[inline]
130    fn default_retained() -> Retained<Self> {
131        Self::new()
132    }
133}