objc2_metal/generated/
MTLResidencySet.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct MTLResidencySetDescriptor;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for MTLResidencySetDescriptor {}
21);
22
23unsafe impl CopyingHelper for MTLResidencySetDescriptor {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for MTLResidencySetDescriptor {}
29);
30
31impl MTLResidencySetDescriptor {
32 extern_methods!(
33 #[unsafe(method(label))]
35 #[unsafe(method_family = none)]
36 pub fn label(&self) -> Option<Retained<NSString>>;
37
38 #[unsafe(method(setLabel:))]
42 #[unsafe(method_family = none)]
43 pub fn setLabel(&self, label: Option<&NSString>);
44
45 #[unsafe(method(initialCapacity))]
47 #[unsafe(method_family = none)]
48 pub fn initialCapacity(&self) -> NSUInteger;
49
50 #[unsafe(method(setInitialCapacity:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setInitialCapacity(&self, initial_capacity: NSUInteger);
58 );
59}
60
61impl MTLResidencySetDescriptor {
63 extern_methods!(
64 #[unsafe(method(init))]
65 #[unsafe(method_family = init)]
66 pub fn init(this: Allocated<Self>) -> Retained<Self>;
67
68 #[unsafe(method(new))]
69 #[unsafe(method_family = new)]
70 pub fn new() -> Retained<Self>;
71 );
72}
73
74impl DefaultRetained for MTLResidencySetDescriptor {
75 #[inline]
76 fn default_retained() -> Retained<Self> {
77 Self::new()
78 }
79}
80
81extern_protocol!(
82 pub unsafe trait MTLResidencySet: NSObjectProtocol {
89 #[cfg(feature = "MTLDevice")]
90 #[unsafe(method(device))]
92 #[unsafe(method_family = none)]
93 fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
94
95 #[unsafe(method(label))]
97 #[unsafe(method_family = none)]
98 fn label(&self) -> Option<Retained<NSString>>;
99
100 #[unsafe(method(allocatedSize))]
102 #[unsafe(method_family = none)]
103 fn allocatedSize(&self) -> u64;
104
105 #[unsafe(method(requestResidency))]
107 #[unsafe(method_family = none)]
108 fn requestResidency(&self);
109
110 #[unsafe(method(endResidency))]
112 #[unsafe(method_family = none)]
113 fn endResidency(&self);
114
115 #[cfg(feature = "MTLAllocation")]
116 #[unsafe(method(addAllocation:))]
118 #[unsafe(method_family = none)]
119 fn addAllocation(&self, allocation: &ProtocolObject<dyn MTLAllocation>);
120
121 #[cfg(feature = "MTLAllocation")]
122 #[unsafe(method(addAllocations:count:))]
129 #[unsafe(method_family = none)]
130 unsafe fn addAllocations_count(
131 &self,
132 allocations: NonNull<NonNull<ProtocolObject<dyn MTLAllocation>>>,
133 count: NSUInteger,
134 );
135
136 #[cfg(feature = "MTLAllocation")]
137 #[unsafe(method(removeAllocation:))]
139 #[unsafe(method_family = none)]
140 fn removeAllocation(&self, allocation: &ProtocolObject<dyn MTLAllocation>);
141
142 #[cfg(feature = "MTLAllocation")]
143 #[unsafe(method(removeAllocations:count:))]
150 #[unsafe(method_family = none)]
151 unsafe fn removeAllocations_count(
152 &self,
153 allocations: NonNull<NonNull<ProtocolObject<dyn MTLAllocation>>>,
154 count: NSUInteger,
155 );
156
157 #[unsafe(method(removeAllAllocations))]
159 #[unsafe(method_family = none)]
160 fn removeAllAllocations(&self);
161
162 #[cfg(feature = "MTLAllocation")]
163 #[unsafe(method(containsAllocation:))]
167 #[unsafe(method_family = none)]
168 fn containsAllocation(&self, an_allocation: &ProtocolObject<dyn MTLAllocation>) -> bool;
169
170 #[cfg(feature = "MTLAllocation")]
171 #[unsafe(method(allAllocations))]
175 #[unsafe(method_family = none)]
176 fn allAllocations(&self) -> Retained<NSArray<ProtocolObject<dyn MTLAllocation>>>;
177
178 #[unsafe(method(allocationCount))]
182 #[unsafe(method_family = none)]
183 fn allocationCount(&self) -> NSUInteger;
184
185 #[unsafe(method(commit))]
189 #[unsafe(method_family = none)]
190 fn commit(&self);
191 }
192);