objc2_core_ml/generated/
MLDictionaryFeatureProvider.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 MLFeatureProvider.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mldictionaryfeatureprovider?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct MLDictionaryFeatureProvider;
16);
17
18#[cfg(feature = "MLFeatureProvider")]
19extern_conformance!(
20    unsafe impl MLFeatureProvider for MLDictionaryFeatureProvider {}
21);
22
23extern_conformance!(
24    unsafe impl NSCoding for MLDictionaryFeatureProvider {}
25);
26
27extern_conformance!(
28    unsafe impl NSFastEnumeration for MLDictionaryFeatureProvider {}
29);
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for MLDictionaryFeatureProvider {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for MLDictionaryFeatureProvider {}
37);
38
39impl MLDictionaryFeatureProvider {
40    extern_methods!(
41        #[cfg(feature = "MLFeatureValue")]
42        /// Dictionary holding the feature values
43        #[unsafe(method(dictionary))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn dictionary(&self) -> Retained<NSDictionary<NSString, MLFeatureValue>>;
46
47        /// Create from a generic dictionary by converting all values to MLFeatureValues
48        /// or from a dictionary with values already stored as MLFeatureValues.
49        ///
50        /// An error results if the values are not or cannot be represented as MLFeatureValues.
51        ///
52        /// # Safety
53        ///
54        /// `dictionary` generic should be of the correct type.
55        #[unsafe(method(initWithDictionary:error:_))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithDictionary_error(
58            this: Allocated<Self>,
59            dictionary: &NSDictionary<NSString, AnyObject>,
60        ) -> Result<Retained<Self>, Retained<NSError>>;
61
62        #[cfg(feature = "MLFeatureValue")]
63        /// Get the value for specified feature
64        #[unsafe(method(objectForKeyedSubscript:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn objectForKeyedSubscript(
67            &self,
68            feature_name: &NSString,
69        ) -> Option<Retained<MLFeatureValue>>;
70    );
71}
72
73/// Methods declared on superclass `NSObject`.
74impl MLDictionaryFeatureProvider {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new() -> Retained<Self>;
83    );
84}