objc2_core_ml/generated/
MLCustomModel.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::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/coreml/mlcustommodel?language=objc)
11    pub unsafe trait MLCustomModel {
12        #[cfg(feature = "MLModelDescription")]
13        /// # Safety
14        ///
15        /// `parameters` generic should be of the correct type.
16        #[unsafe(method(initWithModelDescription:parameterDictionary:error:_))]
17        #[unsafe(method_family = init)]
18        unsafe fn initWithModelDescription_parameterDictionary_error(
19            this: Allocated<Self>,
20            model_description: &MLModelDescription,
21            parameters: &NSDictionary<NSString, AnyObject>,
22        ) -> Result<Retained<Self>, Retained<NSError>>;
23
24        #[cfg(all(feature = "MLFeatureProvider", feature = "MLPredictionOptions"))]
25        #[unsafe(method(predictionFromFeatures:options:error:_))]
26        #[unsafe(method_family = none)]
27        unsafe fn predictionFromFeatures_options_error(
28            &self,
29            input: &ProtocolObject<dyn MLFeatureProvider>,
30            options: &MLPredictionOptions,
31        ) -> Result<Retained<ProtocolObject<dyn MLFeatureProvider>>, Retained<NSError>>;
32
33        #[cfg(all(feature = "MLBatchProvider", feature = "MLPredictionOptions"))]
34        /// Batch prediction with explicit options, if not implemented the single input predictionFromFeatures:options:error will be used
35        #[optional]
36        #[unsafe(method(predictionsFromBatch:options:error:_))]
37        #[unsafe(method_family = none)]
38        unsafe fn predictionsFromBatch_options_error(
39            &self,
40            input_batch: &ProtocolObject<dyn MLBatchProvider>,
41            options: &MLPredictionOptions,
42        ) -> Result<Retained<ProtocolObject<dyn MLBatchProvider>>, Retained<NSError>>;
43    }
44);