objc2_metal/generated/
MTL4SpecializedFunctionDescriptor.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    /// Groups together properties to configure and create a specialized function by passing it to a factory method.
12    ///
13    /// You can pass an instance of this class to any methods that accept a ``MTL4FunctionDescriptor`` parameter to
14    /// provide extra configuration, such as function constants or a name.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4specializedfunctiondescriptor?language=objc)
17    #[unsafe(super(MTL4FunctionDescriptor, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "MTL4FunctionDescriptor")]
20    pub struct MTL4SpecializedFunctionDescriptor;
21);
22
23#[cfg(feature = "MTL4FunctionDescriptor")]
24extern_conformance!(
25    unsafe impl NSCopying for MTL4SpecializedFunctionDescriptor {}
26);
27
28#[cfg(feature = "MTL4FunctionDescriptor")]
29unsafe impl CopyingHelper for MTL4SpecializedFunctionDescriptor {
30    type Result = Self;
31}
32
33#[cfg(feature = "MTL4FunctionDescriptor")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for MTL4SpecializedFunctionDescriptor {}
36);
37
38#[cfg(feature = "MTL4FunctionDescriptor")]
39impl MTL4SpecializedFunctionDescriptor {
40    extern_methods!(
41        /// Provides a descriptor that corresponds to a base function that the specialization applies to.
42        #[unsafe(method(functionDescriptor))]
43        #[unsafe(method_family = none)]
44        pub fn functionDescriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;
45
46        /// Setter for [`functionDescriptor`][Self::functionDescriptor].
47        ///
48        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
49        #[unsafe(method(setFunctionDescriptor:))]
50        #[unsafe(method_family = none)]
51        pub fn setFunctionDescriptor(&self, function_descriptor: Option<&MTL4FunctionDescriptor>);
52
53        /// Assigns an optional name to the specialized function.
54        #[unsafe(method(specializedName))]
55        #[unsafe(method_family = none)]
56        pub fn specializedName(&self) -> Option<Retained<NSString>>;
57
58        /// Setter for [`specializedName`][Self::specializedName].
59        ///
60        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
61        #[unsafe(method(setSpecializedName:))]
62        #[unsafe(method_family = none)]
63        pub fn setSpecializedName(&self, specialized_name: Option<&NSString>);
64
65        #[cfg(feature = "MTLFunctionConstantValues")]
66        /// Configures optional function constant values to associate with the function.
67        #[unsafe(method(constantValues))]
68        #[unsafe(method_family = none)]
69        pub fn constantValues(&self) -> Option<Retained<MTLFunctionConstantValues>>;
70
71        #[cfg(feature = "MTLFunctionConstantValues")]
72        /// Setter for [`constantValues`][Self::constantValues].
73        ///
74        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
75        #[unsafe(method(setConstantValues:))]
76        #[unsafe(method_family = none)]
77        pub fn setConstantValues(&self, constant_values: Option<&MTLFunctionConstantValues>);
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82#[cfg(feature = "MTL4FunctionDescriptor")]
83impl MTL4SpecializedFunctionDescriptor {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub fn new() -> Retained<Self>;
92    );
93}
94
95#[cfg(feature = "MTL4FunctionDescriptor")]
96impl DefaultRetained for MTL4SpecializedFunctionDescriptor {
97    #[inline]
98    fn default_retained() -> Retained<Self> {
99        Self::new()
100    }
101}