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