objc2_metal/generated/
MTL4CommandAllocator.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 MTL4CommandAllocatorDescriptor;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for MTL4CommandAllocatorDescriptor {}
21);
22
23unsafe impl CopyingHelper for MTL4CommandAllocatorDescriptor {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for MTL4CommandAllocatorDescriptor {}
29);
30
31impl MTL4CommandAllocatorDescriptor {
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}
46
47impl MTL4CommandAllocatorDescriptor {
49 extern_methods!(
50 #[unsafe(method(init))]
51 #[unsafe(method_family = init)]
52 pub fn init(this: Allocated<Self>) -> Retained<Self>;
53
54 #[unsafe(method(new))]
55 #[unsafe(method_family = new)]
56 pub fn new() -> Retained<Self>;
57 );
58}
59
60impl DefaultRetained for MTL4CommandAllocatorDescriptor {
61 #[inline]
62 fn default_retained() -> Retained<Self> {
63 Self::new()
64 }
65}
66
67extern_protocol!(
68 pub unsafe trait MTL4CommandAllocator: NSObjectProtocol {
72 #[cfg(feature = "MTLDevice")]
73 #[unsafe(method(device))]
75 #[unsafe(method_family = none)]
76 fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
77
78 #[unsafe(method(label))]
80 #[unsafe(method_family = none)]
81 fn label(&self) -> Option<Retained<NSString>>;
82
83 #[unsafe(method(allocatedSize))]
88 #[unsafe(method_family = none)]
89 fn allocatedSize(&self) -> u64;
90
91 #[unsafe(method(reset))]
99 #[unsafe(method_family = none)]
100 fn reset(&self);
101 }
102);