objc2_core_ml/generated/
MLArrayBatchProvider.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_class!(
10    /// A concrete convenience class conforming to MLBatchProvider.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlarraybatchprovider?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct MLArrayBatchProvider;
16);
17
18#[cfg(feature = "MLBatchProvider")]
19extern_conformance!(
20    unsafe impl MLBatchProvider for MLArrayBatchProvider {}
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for MLArrayBatchProvider {}
25);
26
27impl MLArrayBatchProvider {
28    extern_methods!(
29        #[cfg(feature = "MLFeatureProvider")]
30        #[unsafe(method(array))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn array(&self) -> Retained<NSArray<ProtocolObject<dyn MLFeatureProvider>>>;
33
34        #[cfg(feature = "MLFeatureProvider")]
35        /// Initalize with an array of feature providers
36        #[unsafe(method(initWithFeatureProviderArray:))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn initWithFeatureProviderArray(
39            this: Allocated<Self>,
40            array: &NSArray<ProtocolObject<dyn MLFeatureProvider>>,
41        ) -> Retained<Self>;
42
43        /// Initialize with a dictionary which maps feature names to an array of values [String : [Any]]
44        /// Error is returned if all arrays do not have equal length or if array values
45        /// for a specific feature name do not have the same type or not expressible as MLFeatureValue
46        #[unsafe(method(initWithDictionary:error:_))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithDictionary_error(
49            this: Allocated<Self>,
50            dictionary: &NSDictionary<NSString, NSArray>,
51        ) -> Result<Retained<Self>, Retained<NSError>>;
52    );
53}
54
55/// Methods declared on superclass `NSObject`.
56impl MLArrayBatchProvider {
57    extern_methods!(
58        #[unsafe(method(init))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
61
62        #[unsafe(method(new))]
63        #[unsafe(method_family = new)]
64        pub unsafe fn new() -> Retained<Self>;
65    );
66}