objc2_metal/generated/
MTL4StitchedFunctionDescriptor.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 that describe a shader function suitable for stitching.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4stitchedfunctiondescriptor?language=objc)
14    #[unsafe(super(MTL4FunctionDescriptor, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "MTL4FunctionDescriptor")]
17    pub struct MTL4StitchedFunctionDescriptor;
18);
19
20#[cfg(feature = "MTL4FunctionDescriptor")]
21extern_conformance!(
22    unsafe impl NSCopying for MTL4StitchedFunctionDescriptor {}
23);
24
25#[cfg(feature = "MTL4FunctionDescriptor")]
26unsafe impl CopyingHelper for MTL4StitchedFunctionDescriptor {
27    type Result = Self;
28}
29
30#[cfg(feature = "MTL4FunctionDescriptor")]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for MTL4StitchedFunctionDescriptor {}
33);
34
35#[cfg(feature = "MTL4FunctionDescriptor")]
36impl MTL4StitchedFunctionDescriptor {
37    extern_methods!(
38        #[cfg(feature = "MTLFunctionStitching")]
39        /// Sets the graph representing how to stitch functions together.
40        #[unsafe(method(functionGraph))]
41        #[unsafe(method_family = none)]
42        pub fn functionGraph(&self) -> Option<Retained<MTLFunctionStitchingGraph>>;
43
44        #[cfg(feature = "MTLFunctionStitching")]
45        /// Setter for [`functionGraph`][Self::functionGraph].
46        ///
47        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
48        #[unsafe(method(setFunctionGraph:))]
49        #[unsafe(method_family = none)]
50        pub fn setFunctionGraph(&self, function_graph: Option<&MTLFunctionStitchingGraph>);
51
52        /// Configures an array of function descriptors with references to functions that contribute to the stitching process.
53        #[unsafe(method(functionDescriptors))]
54        #[unsafe(method_family = none)]
55        pub fn functionDescriptors(&self) -> Option<Retained<NSArray<MTL4FunctionDescriptor>>>;
56
57        /// Setter for [`functionDescriptors`][Self::functionDescriptors].
58        ///
59        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
60        #[unsafe(method(setFunctionDescriptors:))]
61        #[unsafe(method_family = none)]
62        pub fn setFunctionDescriptors(
63            &self,
64            function_descriptors: Option<&NSArray<MTL4FunctionDescriptor>>,
65        );
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70#[cfg(feature = "MTL4FunctionDescriptor")]
71impl MTL4StitchedFunctionDescriptor {
72    extern_methods!(
73        #[unsafe(method(init))]
74        #[unsafe(method_family = init)]
75        pub fn init(this: Allocated<Self>) -> Retained<Self>;
76
77        #[unsafe(method(new))]
78        #[unsafe(method_family = new)]
79        pub fn new() -> Retained<Self>;
80    );
81}
82
83#[cfg(feature = "MTL4FunctionDescriptor")]
84impl DefaultRetained for MTL4StitchedFunctionDescriptor {
85    #[inline]
86    fn default_retained() -> Retained<Self> {
87        Self::new()
88    }
89}