objc2_metal/generated/
MTLFunctionConstantValues.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    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionconstantvalues?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct MTLFunctionConstantValues;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for MTLFunctionConstantValues {}
19);
20
21unsafe impl CopyingHelper for MTLFunctionConstantValues {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MTLFunctionConstantValues {}
27);
28
29impl MTLFunctionConstantValues {
30    extern_methods!(
31        #[cfg(feature = "MTLDataType")]
32        /// # Safety
33        ///
34        /// - `value` must be a valid pointer.
35        /// - `index` might not be bounds-checked.
36        #[unsafe(method(setConstantValue:type:atIndex:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn setConstantValue_type_atIndex(
39            &self,
40            value: NonNull<c_void>,
41            r#type: MTLDataType,
42            index: NSUInteger,
43        );
44
45        #[cfg(feature = "MTLDataType")]
46        /// # Safety
47        ///
48        /// - `values` must be a valid pointer.
49        /// - `range` might not be bounds-checked.
50        #[unsafe(method(setConstantValues:type:withRange:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setConstantValues_type_withRange(
53            &self,
54            values: NonNull<c_void>,
55            r#type: MTLDataType,
56            range: NSRange,
57        );
58
59        #[cfg(feature = "MTLDataType")]
60        /// # Safety
61        ///
62        /// `value` must be a valid pointer.
63        #[unsafe(method(setConstantValue:type:withName:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setConstantValue_type_withName(
66            &self,
67            value: NonNull<c_void>,
68            r#type: MTLDataType,
69            name: &NSString,
70        );
71
72        #[unsafe(method(reset))]
73        #[unsafe(method_family = none)]
74        pub fn reset(&self);
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79impl MTLFunctionConstantValues {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub fn new() -> Retained<Self>;
88    );
89}
90
91impl DefaultRetained for MTLFunctionConstantValues {
92    #[inline]
93    fn default_retained() -> Retained<Self> {
94        Self::new()
95    }
96}