objc2-core-ml 0.3.2

Bindings to the CoreML framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreml/mlcustommodel?language=objc)
    pub unsafe trait MLCustomModel {
        #[cfg(feature = "MLModelDescription")]
        /// # Safety
        ///
        /// `parameters` generic should be of the correct type.
        #[unsafe(method(initWithModelDescription:parameterDictionary:error:_))]
        #[unsafe(method_family = init)]
        unsafe fn initWithModelDescription_parameterDictionary_error(
            this: Allocated<Self>,
            model_description: &MLModelDescription,
            parameters: &NSDictionary<NSString, AnyObject>,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(all(feature = "MLFeatureProvider", feature = "MLPredictionOptions"))]
        #[unsafe(method(predictionFromFeatures:options:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn predictionFromFeatures_options_error(
            &self,
            input: &ProtocolObject<dyn MLFeatureProvider>,
            options: &MLPredictionOptions,
        ) -> Result<Retained<ProtocolObject<dyn MLFeatureProvider>>, Retained<NSError>>;

        #[cfg(all(feature = "MLBatchProvider", feature = "MLPredictionOptions"))]
        /// Batch prediction with explicit options, if not implemented the single input predictionFromFeatures:options:error will be used
        #[optional]
        #[unsafe(method(predictionsFromBatch:options:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn predictionsFromBatch_options_error(
            &self,
            input_batch: &ProtocolObject<dyn MLBatchProvider>,
            options: &MLPredictionOptions,
        ) -> Result<Retained<ProtocolObject<dyn MLBatchProvider>>, Retained<NSError>>;
    }
);