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_class!(
    /// A concrete convenience class conforming to MLBatchProvider.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlarraybatchprovider?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MLArrayBatchProvider;
);

#[cfg(feature = "MLBatchProvider")]
extern_conformance!(
    unsafe impl MLBatchProvider for MLArrayBatchProvider {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MLArrayBatchProvider {}
);

impl MLArrayBatchProvider {
    extern_methods!(
        #[cfg(feature = "MLFeatureProvider")]
        #[unsafe(method(array))]
        #[unsafe(method_family = none)]
        pub unsafe fn array(&self) -> Retained<NSArray<ProtocolObject<dyn MLFeatureProvider>>>;

        #[cfg(feature = "MLFeatureProvider")]
        /// Initalize with an array of feature providers
        #[unsafe(method(initWithFeatureProviderArray:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFeatureProviderArray(
            this: Allocated<Self>,
            array: &NSArray<ProtocolObject<dyn MLFeatureProvider>>,
        ) -> Retained<Self>;

        /// Initialize with a dictionary which maps feature names to an array of values [String : [Any]]
        /// Error is returned if all arrays do not have equal length or if array values
        /// for a specific feature name do not have the same type or not expressible as MLFeatureValue
        ///
        /// # Safety
        ///
        /// `dictionary` generic generic should be of the correct type.
        #[unsafe(method(initWithDictionary:error:_))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDictionary_error(
            this: Allocated<Self>,
            dictionary: &NSDictionary<NSString, NSArray>,
        ) -> Result<Retained<Self>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MLArrayBatchProvider {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}