objc2_metal/generated/
MTLResourceViewPool.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 MTLResourceViewPoolDescriptor;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for MTLResourceViewPoolDescriptor {}
21);
22
23unsafe impl CopyingHelper for MTLResourceViewPoolDescriptor {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for MTLResourceViewPoolDescriptor {}
29);
30
31impl MTLResourceViewPoolDescriptor {
32 extern_methods!(
33 #[unsafe(method(resourceViewCount))]
35 #[unsafe(method_family = none)]
36 pub fn resourceViewCount(&self) -> NSUInteger;
37
38 #[unsafe(method(setResourceViewCount:))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn setResourceViewCount(&self, resource_view_count: NSUInteger);
46
47 #[unsafe(method(label))]
49 #[unsafe(method_family = none)]
50 pub fn label(&self) -> Option<Retained<NSString>>;
51
52 #[unsafe(method(setLabel:))]
56 #[unsafe(method_family = none)]
57 pub fn setLabel(&self, label: Option<&NSString>);
58 );
59}
60
61impl MTLResourceViewPoolDescriptor {
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 MTLResourceViewPoolDescriptor {
75 #[inline]
76 fn default_retained() -> Retained<Self> {
77 Self::new()
78 }
79}
80
81extern_protocol!(
82 pub unsafe trait MTLResourceViewPool: NSObjectProtocol {
86 #[cfg(feature = "MTLTypes")]
87 #[unsafe(method(baseResourceID))]
89 #[unsafe(method_family = none)]
90 fn baseResourceID(&self) -> MTLResourceID;
91
92 #[unsafe(method(resourceViewCount))]
94 #[unsafe(method_family = none)]
95 fn resourceViewCount(&self) -> NSUInteger;
96
97 #[cfg(feature = "MTLDevice")]
98 #[unsafe(method(device))]
100 #[unsafe(method_family = none)]
101 fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
102
103 #[unsafe(method(label))]
105 #[unsafe(method_family = none)]
106 fn label(&self) -> Option<Retained<NSString>>;
107
108 #[cfg(feature = "MTLTypes")]
109 #[unsafe(method(copyResourceViewsFromPool:sourceRange:destinationIndex:))]
123 #[unsafe(method_family = none)]
124 unsafe fn copyResourceViewsFromPool_sourceRange_destinationIndex(
125 &self,
126 source_pool: &ProtocolObject<dyn MTLResourceViewPool>,
127 source_range: NSRange,
128 destination_index: NSUInteger,
129 ) -> MTLResourceID;
130 }
131);