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
//! 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::*;
/// MLModelCompilation.
///
/// MLModel (MLModelCompilation)
///
/// Class with utilties for performing .mlmodel compilation
#[cfg(feature = "MLModel")]
impl MLModel {
extern_methods!(
/// Compile a .mlmodel for this device
///
///
/// Parameter `modelURL`: URL file path to .mlmodel file you wish to compile
///
/// Parameter `error`: Any errors are surfaced here
///
///
/// Returns: a URL to the compiled .mlmodelc directory if successful
/// The model is compiled to a temporary location on disk
/// You must move the compiled model to a permanent location if you wish to keep it
///
///
/// The returned model can be loaded using:
///
/// ```text
/// [MLModel modelWithContentsOfURL:error:]
/// ```
#[deprecated = "Use the asynchronous interface compileModelAtURL:completionHandler:error: instead."]
#[unsafe(method(compileModelAtURL:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn compileModelAtURL_error(
model_url: &NSURL,
) -> Result<Retained<NSURL>, Retained<NSError>>;
#[cfg(feature = "block2")]
/// Compile a .mlmodel or .mlpackage for this device. Perform the compilation asynchronously.
///
///
/// Parameter `modelURL`: URL file path to .mlmodel file you wish to compile
///
/// Parameter `handler`: When the model compilation completes successfully the completion handler is invoked with a valid URL to the compiled .mlmodelc directory.
/// On failure, signified by nil compiledModelURL, the NSError object is populated.
///
///
/// The model is compiled to a temporary location in the file system. You must move the compiled model to a permanent location if you wish to keep it. Then the model can be loaded using the returned URL:
///
/// ```text
/// [MLModel modelWithContentsOfURL:error:]
/// ```
#[unsafe(method(compileModelAtURL:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn compileModelAtURL_completionHandler(
model_url: &NSURL,
handler: &block2::DynBlock<dyn Fn(*mut NSURL, *mut NSError)>,
);
);
}