objc2_metal_performance_shaders/generated/MPSNeuralNetwork/
MPSNNSlice.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6use objc2_metal::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnslice?language=objc)
12    #[unsafe(super(MPSCNNKernel, MPSKernel, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
15    pub struct MPSNNSlice;
16);
17
18#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
19extern_conformance!(
20    unsafe impl NSCoding for MPSNNSlice {}
21);
22
23#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
24extern_conformance!(
25    unsafe impl NSCopying for MPSNNSlice {}
26);
27
28#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
29unsafe impl CopyingHelper for MPSNNSlice {
30    type Result = Self;
31}
32
33#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for MPSNNSlice {}
36);
37
38#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
39extern_conformance!(
40    unsafe impl NSSecureCoding for MPSNNSlice {}
41);
42
43#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
44impl MPSNNSlice {
45    extern_methods!(
46        /// Initialize a MPSNNSlice kernel
47        ///
48        /// Parameter `device`: The device the filter will run on
49        ///
50        /// Returns: A valid MPSNNSlice object or nil, if failure.
51        #[unsafe(method(initWithDevice:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithDevice(
54            this: Allocated<Self>,
55            device: &ProtocolObject<dyn MTLDevice>,
56        ) -> Retained<Self>;
57
58        /// # Safety
59        ///
60        /// `a_decoder` possibly has further requirements.
61        #[unsafe(method(initWithCoder:device:))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn initWithCoder_device(
64            this: Allocated<Self>,
65            a_decoder: &NSCoder,
66            device: &ProtocolObject<dyn MTLDevice>,
67        ) -> Option<Retained<Self>>;
68    );
69}
70
71/// Methods declared on superclass `MPSKernel`.
72#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
73impl MPSNNSlice {
74    extern_methods!(
75        /// Called by NSCoder to decode MPSKernels
76        ///
77        /// This isn't the right interface to decode a MPSKernel, but
78        /// it is the one that NSCoder uses. To enable your NSCoder
79        /// (e.g. NSKeyedUnarchiver) to set which device to use
80        /// extend the object to adopt the MPSDeviceProvider
81        /// protocol. Otherwise, the Metal system default device
82        /// will be used.
83        ///
84        /// # Safety
85        ///
86        /// `a_decoder` possibly has further requirements.
87        #[unsafe(method(initWithCoder:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithCoder(
90            this: Allocated<Self>,
91            a_decoder: &NSCoder,
92        ) -> Option<Retained<Self>>;
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
98impl MPSNNSlice {
99    extern_methods!(
100        #[unsafe(method(init))]
101        #[unsafe(method_family = init)]
102        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new() -> Retained<Self>;
107    );
108}