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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/photos/phcloudidentifier?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PHCloudIdentifier;
);
unsafe impl Send for PHCloudIdentifier {}
unsafe impl Sync for PHCloudIdentifier {}
extern_conformance!(
unsafe impl NSCoding for PHCloudIdentifier {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for PHCloudIdentifier {}
);
extern_conformance!(
unsafe impl NSSecureCoding for PHCloudIdentifier {}
);
impl PHCloudIdentifier {
extern_methods!(
/// DEPRECATED: If there is a failure to determine the global identifier for a local identifier, the notFoundIdentifier is provided in that array slot.
#[deprecated]
#[unsafe(method(notFoundIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn notFoundIdentifier() -> Retained<PHCloudIdentifier>;
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(stringValue))]
#[unsafe(method_family = none)]
pub unsafe fn stringValue(&self) -> Retained<NSString>;
/// For use in serialization
#[unsafe(method(initWithStringValue:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithStringValue(
this: Allocated<Self>,
string_value: &NSString,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl PHCloudIdentifier {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
/// Contains the cloud identifier result from looking up a local identifier via
/// `cloudIdentifierMappingsForLocalIdentifiers,`or an
/// `error`indicating why the lookup failed
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/photos/phcloudidentifiermapping?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PHCloudIdentifierMapping;
);
unsafe impl Send for PHCloudIdentifierMapping {}
unsafe impl Sync for PHCloudIdentifierMapping {}
extern_conformance!(
unsafe impl NSObjectProtocol for PHCloudIdentifierMapping {}
);
impl PHCloudIdentifierMapping {
extern_methods!(
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(cloudIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn cloudIdentifier(&self) -> Option<Retained<PHCloudIdentifier>>;
/// The cloud identifier of the resource found for this local identifier
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(error))]
#[unsafe(method_family = none)]
pub unsafe fn error(&self) -> Option<Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
impl PHCloudIdentifierMapping {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
/// Contains the local identifier result from looking up a cloud identifier via
/// `localIdentifierMappingsForCloudIdentifiers,`or an
/// `error`indicating why the lookup failed
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/photos/phlocalidentifiermapping?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PHLocalIdentifierMapping;
);
unsafe impl Send for PHLocalIdentifierMapping {}
unsafe impl Sync for PHLocalIdentifierMapping {}
extern_conformance!(
unsafe impl NSObjectProtocol for PHLocalIdentifierMapping {}
);
impl PHLocalIdentifierMapping {
extern_methods!(
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(localIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn localIdentifier(&self) -> Option<Retained<NSString>>;
/// The
/// `NSString`representing the local identifier of the resource found for this cloud identifier, or nil if the match was not found.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(error))]
#[unsafe(method_family = none)]
pub unsafe fn error(&self) -> Option<Retained<NSError>>;
);
}
/// Methods declared on superclass `NSObject`.
impl PHLocalIdentifierMapping {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
impl PHCloudIdentifier {
extern_methods!();
}
extern_conformance!(
unsafe impl NSCopying for PHCloudIdentifier {}
);
unsafe impl CopyingHelper for PHCloudIdentifier {
type Result = Self;
}
/// CloudIdentifiers.
#[cfg(feature = "PHPhotoLibrary")]
impl PHPhotoLibrary {
extern_methods!(
/// Returns a dictionary that maps each cloud identifier from the provided array to a PLLocalIdentifierMapping result containing the local identifier found for that cloud identifier.
///
/// This method can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage. If the attempt to lookup a local identifier for a given cloud identifier fails, the error parameter will indicate the reason.
///
/// Parameter `cloudIdentifiers`: The array of
/// `PHCloudIdentifier`instances whose local identifiers are to being requested.
#[unsafe(method(localIdentifierMappingsForCloudIdentifiers:))]
#[unsafe(method_family = none)]
pub unsafe fn localIdentifierMappingsForCloudIdentifiers(
&self,
cloud_identifiers: &NSArray<PHCloudIdentifier>,
) -> Retained<NSDictionary<PHCloudIdentifier, PHLocalIdentifierMapping>>;
/// Returns a dictionary that maps each local identifier from the provided array to a PLCloudIdentifierMapping result containing the cloud identifier found for that local identifier
///
/// This method can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage. If the attempt to lookup a cloud identifier for a given local identifier fails, the error parameter will indicate the reason.
///
/// Parameter `localIdentifiers`: The array of
/// `NSString`instances whose cloud identifiers are to being requested.
#[unsafe(method(cloudIdentifierMappingsForLocalIdentifiers:))]
#[unsafe(method_family = none)]
pub unsafe fn cloudIdentifierMappingsForLocalIdentifiers(
&self,
local_identifiers: &NSArray<NSString>,
) -> Retained<NSDictionary<NSString, PHCloudIdentifierMapping>>;
/// DEPRECATED: These two methods can be very expensive so they should be used sparingly for batch lookup of all needed identifiers. Clients should work in terms of local identifiers and call these methods only once after loading from and before saving to persistent storage.
#[deprecated]
#[unsafe(method(localIdentifiersForCloudIdentifiers:))]
#[unsafe(method_family = none)]
pub unsafe fn localIdentifiersForCloudIdentifiers(
&self,
cloud_identifiers: &NSArray<PHCloudIdentifier>,
) -> Retained<NSArray<NSString>>;
#[deprecated]
#[unsafe(method(cloudIdentifiersForLocalIdentifiers:))]
#[unsafe(method_family = none)]
pub unsafe fn cloudIdentifiersForLocalIdentifiers(
&self,
local_identifiers: &NSArray<NSString>,
) -> Retained<NSArray<PHCloudIdentifier>>;
);
}
extern "C" {
/// DEPRECATED: If the local object cannot be resolved from a global identifier, PHLocalIdentifierNotFound is provided in that array slot.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/photos/phlocalidentifiernotfound?language=objc)
#[deprecated]
pub static PHLocalIdentifierNotFound: &'static NSString;
}