objc2_core_ml/generated/
MLModelCollection.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// MLModelCollection
12    ///
13    /// A collection of models managed as part of Core ML Model Deployment.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlmodelcollection?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[deprecated = "Use Background Assets or NSURLSession instead."]
19    pub struct MLModelCollection;
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for MLModelCollection {}
24);
25
26impl MLModelCollection {
27    extern_methods!(
28        /// The identifier of the model collection you want to access, as configured in the Core ML Model Deployment dashboard.
29        #[deprecated = "Use Background Assets or NSURLSession instead."]
30        #[unsafe(method(identifier))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn identifier(&self) -> Retained<NSString>;
33
34        #[cfg(feature = "MLModelCollectionEntry")]
35        /// Information about the models downloaded in the collection, or an empty dictionary if the collection has not been downloaded.
36        #[deprecated = "Use Background Assets or NSURLSession instead."]
37        #[unsafe(method(entries))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn entries(&self) -> Retained<NSDictionary<NSString, MLModelCollectionEntry>>;
40
41        /// The identifier for the currently downloaded deployment, corresponding to a recent deployment on the Core ML Model Deployment dashboard.
42        #[deprecated = "Use Background Assets or NSURLSession instead."]
43        #[unsafe(method(deploymentID))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn deploymentID(&self) -> Retained<NSString>;
46
47        #[cfg(feature = "block2")]
48        /// Request access to a model collection. If the collection is not downloaded on the device, it is requested
49        /// from Core ML Model Deployment.
50        ///
51        ///
52        /// When called, this method downloads the model collection if it is not already on the device. Once
53        /// all models are downloaded, an MLModelCollection instance is made available for use with the completion handler.
54        ///
55        ///
56        /// Parameter `identifier`: The model collection identifier, as managed in Core ML Model Deployment.
57        ///
58        /// Parameter `completionHandler`: The completion handler, invoked with a valid MLModelCollection instance on success or NSError on failure.
59        ///
60        /// Returns: NSProgress for updates during setup and download of the model collection
61        #[deprecated = "Use Background Assets or NSURLSession instead."]
62        #[unsafe(method(beginAccessingModelCollectionWithIdentifier:completionHandler:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn beginAccessingModelCollectionWithIdentifier_completionHandler(
65            identifier: &NSString,
66            completion_handler: &block2::DynBlock<dyn Fn(*mut MLModelCollection, *mut NSError)>,
67        ) -> Retained<NSProgress>;
68
69        #[cfg(feature = "block2")]
70        /// End access to a model collection. This informs the system you have finished accessing the models within the collection.
71        ///
72        ///
73        /// Call this method as soon as you have finished using the models in this collection.
74        ///
75        ///
76        /// Parameter `identifier`: The model collection identifier, as managed in Core ML Model Deployment.
77        ///
78        /// Parameter `completionHandler`: The completion handler, invoked with YES on success or NSError on failure.
79        #[deprecated = "Use Background Assets or NSURLSession instead."]
80        #[unsafe(method(endAccessingModelCollectionWithIdentifier:completionHandler:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn endAccessingModelCollectionWithIdentifier_completionHandler(
83            identifier: &NSString,
84            completion_handler: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
85        );
86
87        #[deprecated = "Use Background Assets or NSURLSession instead."]
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[deprecated = "Use Background Assets or NSURLSession instead."]
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub unsafe fn new() -> Retained<Self>;
96    );
97}
98
99extern "C" {
100    /// Notification posted when the model collection has changed.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlmodelcollectiondidchangenotification?language=objc)
103    pub static MLModelCollectionDidChangeNotification: &'static NSNotificationName;
104}