objc2_metal/generated/
MTL4BinaryFunctionDescriptor.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct MTL4BinaryFunctionOptions(pub NSUInteger);
17bitflags::bitflags! {
18 impl MTL4BinaryFunctionOptions: NSUInteger {
19#[doc(alias = "MTL4BinaryFunctionOptionNone")]
21 const None = 0;
22#[doc(alias = "MTL4BinaryFunctionOptionPipelineIndependent")]
25 const PipelineIndependent = 1<<1;
26 }
27}
28
29unsafe impl Encode for MTL4BinaryFunctionOptions {
30 const ENCODING: Encoding = NSUInteger::ENCODING;
31}
32
33unsafe impl RefEncode for MTL4BinaryFunctionOptions {
34 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37extern_class!(
38 #[unsafe(super(NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 pub struct MTL4BinaryFunctionDescriptor;
44);
45
46extern_conformance!(
47 unsafe impl NSCopying for MTL4BinaryFunctionDescriptor {}
48);
49
50unsafe impl CopyingHelper for MTL4BinaryFunctionDescriptor {
51 type Result = Self;
52}
53
54extern_conformance!(
55 unsafe impl NSObjectProtocol for MTL4BinaryFunctionDescriptor {}
56);
57
58impl MTL4BinaryFunctionDescriptor {
59 extern_methods!(
60 #[unsafe(method(name))]
64 #[unsafe(method_family = none)]
65 pub fn name(&self) -> Retained<NSString>;
66
67 #[unsafe(method(setName:))]
71 #[unsafe(method_family = none)]
72 pub fn setName(&self, name: &NSString);
73
74 #[cfg(feature = "MTL4FunctionDescriptor")]
75 #[unsafe(method(functionDescriptor))]
77 #[unsafe(method_family = none)]
78 pub fn functionDescriptor(&self) -> Retained<MTL4FunctionDescriptor>;
79
80 #[cfg(feature = "MTL4FunctionDescriptor")]
81 #[unsafe(method(setFunctionDescriptor:))]
85 #[unsafe(method_family = none)]
86 pub fn setFunctionDescriptor(&self, function_descriptor: &MTL4FunctionDescriptor);
87
88 #[unsafe(method(options))]
90 #[unsafe(method_family = none)]
91 pub fn options(&self) -> MTL4BinaryFunctionOptions;
92
93 #[unsafe(method(setOptions:))]
95 #[unsafe(method_family = none)]
96 pub fn setOptions(&self, options: MTL4BinaryFunctionOptions);
97 );
98}
99
100impl MTL4BinaryFunctionDescriptor {
102 extern_methods!(
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(new))]
108 #[unsafe(method_family = new)]
109 pub fn new() -> Retained<Self>;
110 );
111}
112
113impl DefaultRetained for MTL4BinaryFunctionDescriptor {
114 #[inline]
115 fn default_retained() -> Retained<Self> {
116 Self::new()
117 }
118}