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        #[unsafe(method(initWithDictionary:error:_))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithDictionary_error(
54            this: Allocated<Self>,
55            dictionary: &NSDictionary<NSString, AnyObject>,
56        ) -> Result<Retained<Self>, Retained<NSError>>;
57
58        #[cfg(feature = "MLFeatureValue")]
59        /// Get the value for specified feature
60        #[unsafe(method(objectForKeyedSubscript:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn objectForKeyedSubscript(
63            &self,
64            feature_name: &NSString,
65        ) -> Option<Retained<MLFeatureValue>>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl MLDictionaryFeatureProvider {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}