objc2-core-location 0.3.2

Bindings to the CoreLocation framework
Documentation
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/cldeviceorientation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLDeviceOrientation(pub c_int);
impl CLDeviceOrientation {
    #[doc(alias = "CLDeviceOrientationUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "CLDeviceOrientationPortrait")]
    pub const Portrait: Self = Self(1);
    #[doc(alias = "CLDeviceOrientationPortraitUpsideDown")]
    pub const PortraitUpsideDown: Self = Self(2);
    #[doc(alias = "CLDeviceOrientationLandscapeLeft")]
    pub const LandscapeLeft: Self = Self(3);
    #[doc(alias = "CLDeviceOrientationLandscapeRight")]
    pub const LandscapeRight: Self = Self(4);
    #[doc(alias = "CLDeviceOrientationFaceUp")]
    pub const FaceUp: Self = Self(5);
    #[doc(alias = "CLDeviceOrientationFaceDown")]
    pub const FaceDown: Self = Self(6);
}

unsafe impl Encode for CLDeviceOrientation {
    const ENCODING: Encoding = c_int::ENCODING;
}

unsafe impl RefEncode for CLDeviceOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clauthorizationstatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLAuthorizationStatus(pub c_int);
impl CLAuthorizationStatus {
    #[doc(alias = "kCLAuthorizationStatusNotDetermined")]
    pub const NotDetermined: Self = Self(0);
    #[doc(alias = "kCLAuthorizationStatusRestricted")]
    pub const Restricted: Self = Self(1);
    #[doc(alias = "kCLAuthorizationStatusDenied")]
    pub const Denied: Self = Self(2);
    #[doc(alias = "kCLAuthorizationStatusAuthorizedAlways")]
    pub const AuthorizedAlways: Self = Self(3);
    #[doc(alias = "kCLAuthorizationStatusAuthorizedWhenInUse")]
    pub const AuthorizedWhenInUse: Self = Self(4);
    #[doc(alias = "kCLAuthorizationStatusAuthorized")]
    #[deprecated = "Use kCLAuthorizationStatusAuthorizedAlways"]
    pub const Authorized: Self = Self(CLAuthorizationStatus::AuthorizedAlways.0);
}

unsafe impl Encode for CLAuthorizationStatus {
    const ENCODING: Encoding = c_int::ENCODING;
}

unsafe impl RefEncode for CLAuthorizationStatus {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/claccuracyauthorization?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLAccuracyAuthorization(pub NSInteger);
impl CLAccuracyAuthorization {
    #[doc(alias = "CLAccuracyAuthorizationFullAccuracy")]
    pub const FullAccuracy: Self = Self(0);
    #[doc(alias = "CLAccuracyAuthorizationReducedAccuracy")]
    pub const ReducedAccuracy: Self = Self(1);
}

unsafe impl Encode for CLAccuracyAuthorization {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CLAccuracyAuthorization {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clactivitytype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLActivityType(pub NSInteger);
impl CLActivityType {
    #[doc(alias = "CLActivityTypeOther")]
    pub const Other: Self = Self(1);
    #[doc(alias = "CLActivityTypeAutomotiveNavigation")]
    pub const AutomotiveNavigation: Self = Self(2);
    #[doc(alias = "CLActivityTypeFitness")]
    pub const Fitness: Self = Self(3);
    #[doc(alias = "CLActivityTypeOtherNavigation")]
    pub const OtherNavigation: Self = Self(4);
    #[doc(alias = "CLActivityTypeAirborne")]
    pub const Airborne: Self = Self(5);
}

unsafe impl Encode for CLActivityType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CLActivityType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/corelocation/cllocationmanager?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CLLocationManager;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CLLocationManager {}
);

impl CLLocationManager {
    extern_methods!(
        #[unsafe(method(locationServicesEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn locationServicesEnabled_class() -> bool;

        #[unsafe(method(headingAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn headingAvailable_class() -> bool;

        #[unsafe(method(significantLocationChangeMonitoringAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn significantLocationChangeMonitoringAvailable() -> bool;

        /// # Safety
        ///
        /// `region_class` probably has further requirements.
        #[unsafe(method(isMonitoringAvailableForClass:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isMonitoringAvailableForClass(region_class: &AnyClass) -> bool;

        #[deprecated]
        #[unsafe(method(regionMonitoringAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionMonitoringAvailable() -> bool;

        #[deprecated = "Use +isMonitoringAvailableForClass: and -authorizationStatus instead"]
        #[unsafe(method(regionMonitoringEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionMonitoringEnabled() -> bool;

        #[unsafe(method(isRangingAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isRangingAvailable() -> bool;

        #[unsafe(method(authorizationStatus))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationStatus(&self) -> CLAuthorizationStatus;

        #[deprecated]
        #[unsafe(method(authorizationStatus))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationStatus_class() -> CLAuthorizationStatus;

        #[unsafe(method(accuracyAuthorization))]
        #[unsafe(method_family = none)]
        pub unsafe fn accuracyAuthorization(&self) -> CLAccuracyAuthorization;

        #[unsafe(method(isAuthorizedForWidgetUpdates))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAuthorizedForWidgetUpdates(&self) -> bool;

        #[cfg(feature = "CLLocationManagerDelegate")]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn CLLocationManagerDelegate>>>;

        #[cfg(feature = "CLLocationManagerDelegate")]
        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn CLLocationManagerDelegate>>,
        );

        #[deprecated]
        #[unsafe(method(locationServicesEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn locationServicesEnabled(&self) -> bool;

        #[deprecated = "Set the purpose string in Info.plist using key NSLocationUsageDescription"]
        #[unsafe(method(purpose))]
        #[unsafe(method_family = none)]
        pub unsafe fn purpose(&self) -> Option<Retained<NSString>>;

        /// Setter for [`purpose`][Self::purpose].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Set the purpose string in Info.plist using key NSLocationUsageDescription"]
        #[unsafe(method(setPurpose:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPurpose(&self, purpose: Option<&NSString>);

        #[unsafe(method(activityType))]
        #[unsafe(method_family = none)]
        pub unsafe fn activityType(&self) -> CLActivityType;

        /// Setter for [`activityType`][Self::activityType].
        #[unsafe(method(setActivityType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActivityType(&self, activity_type: CLActivityType);

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(distanceFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn distanceFilter(&self) -> CLLocationDistance;

        #[cfg(feature = "CLLocation")]
        /// Setter for [`distanceFilter`][Self::distanceFilter].
        #[unsafe(method(setDistanceFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDistanceFilter(&self, distance_filter: CLLocationDistance);

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(desiredAccuracy))]
        #[unsafe(method_family = none)]
        pub unsafe fn desiredAccuracy(&self) -> CLLocationAccuracy;

        #[cfg(feature = "CLLocation")]
        /// Setter for [`desiredAccuracy`][Self::desiredAccuracy].
        #[unsafe(method(setDesiredAccuracy:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDesiredAccuracy(&self, desired_accuracy: CLLocationAccuracy);

        #[unsafe(method(pausesLocationUpdatesAutomatically))]
        #[unsafe(method_family = none)]
        pub unsafe fn pausesLocationUpdatesAutomatically(&self) -> bool;

        /// Setter for [`pausesLocationUpdatesAutomatically`][Self::pausesLocationUpdatesAutomatically].
        #[unsafe(method(setPausesLocationUpdatesAutomatically:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPausesLocationUpdatesAutomatically(
            &self,
            pauses_location_updates_automatically: bool,
        );

        #[unsafe(method(allowsBackgroundLocationUpdates))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsBackgroundLocationUpdates(&self) -> bool;

        /// Setter for [`allowsBackgroundLocationUpdates`][Self::allowsBackgroundLocationUpdates].
        #[unsafe(method(setAllowsBackgroundLocationUpdates:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowsBackgroundLocationUpdates(
            &self,
            allows_background_location_updates: bool,
        );

        #[unsafe(method(showsBackgroundLocationIndicator))]
        #[unsafe(method_family = none)]
        pub unsafe fn showsBackgroundLocationIndicator(&self) -> bool;

        /// Setter for [`showsBackgroundLocationIndicator`][Self::showsBackgroundLocationIndicator].
        #[unsafe(method(setShowsBackgroundLocationIndicator:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShowsBackgroundLocationIndicator(
            &self,
            shows_background_location_indicator: bool,
        );

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(location))]
        #[unsafe(method_family = none)]
        pub unsafe fn location(&self) -> Option<Retained<CLLocation>>;

        #[deprecated]
        #[unsafe(method(headingAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn headingAvailable(&self) -> bool;

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(headingFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn headingFilter(&self) -> CLLocationDegrees;

        #[cfg(feature = "CLLocation")]
        /// Setter for [`headingFilter`][Self::headingFilter].
        #[unsafe(method(setHeadingFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHeadingFilter(&self, heading_filter: CLLocationDegrees);

        #[unsafe(method(headingOrientation))]
        #[unsafe(method_family = none)]
        pub unsafe fn headingOrientation(&self) -> CLDeviceOrientation;

        /// Setter for [`headingOrientation`][Self::headingOrientation].
        #[unsafe(method(setHeadingOrientation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHeadingOrientation(&self, heading_orientation: CLDeviceOrientation);

        #[cfg(feature = "CLHeading")]
        #[unsafe(method(heading))]
        #[unsafe(method_family = none)]
        pub unsafe fn heading(&self) -> Option<Retained<CLHeading>>;

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(maximumRegionMonitoringDistance))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumRegionMonitoringDistance(&self) -> CLLocationDistance;

        #[cfg(feature = "CLRegion")]
        #[unsafe(method(monitoredRegions))]
        #[unsafe(method_family = none)]
        pub unsafe fn monitoredRegions(&self) -> Retained<NSSet<CLRegion>>;

        #[cfg(feature = "CLRegion")]
        #[deprecated = "Use -rangedBeaconConstraints"]
        #[unsafe(method(rangedRegions))]
        #[unsafe(method_family = none)]
        pub unsafe fn rangedRegions(&self) -> Retained<NSSet<CLRegion>>;

        #[cfg(all(
            feature = "CLBeaconIdentityCondition",
            feature = "CLBeaconIdentityConstraint",
            feature = "CLCondition"
        ))]
        #[unsafe(method(rangedBeaconConstraints))]
        #[unsafe(method_family = none)]
        pub unsafe fn rangedBeaconConstraints(&self)
            -> Retained<NSSet<CLBeaconIdentityConstraint>>;

        #[unsafe(method(requestWhenInUseAuthorization))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestWhenInUseAuthorization(&self);

        #[unsafe(method(requestAlwaysAuthorization))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestAlwaysAuthorization(&self);

        #[cfg(feature = "block2")]
        #[unsafe(method(requestTemporaryFullAccuracyAuthorizationWithPurposeKey:completion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestTemporaryFullAccuracyAuthorizationWithPurposeKey_completion(
            &self,
            purpose_key: &NSString,
            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[unsafe(method(requestTemporaryFullAccuracyAuthorizationWithPurposeKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestTemporaryFullAccuracyAuthorizationWithPurposeKey(
            &self,
            purpose_key: &NSString,
        );

        #[unsafe(method(startUpdatingLocation))]
        #[unsafe(method_family = none)]
        pub unsafe fn startUpdatingLocation(&self);

        #[unsafe(method(stopUpdatingLocation))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopUpdatingLocation(&self);

        #[unsafe(method(requestLocation))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestLocation(&self);

        #[unsafe(method(startUpdatingHeading))]
        #[unsafe(method_family = none)]
        pub unsafe fn startUpdatingHeading(&self);

        #[unsafe(method(stopUpdatingHeading))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopUpdatingHeading(&self);

        #[unsafe(method(dismissHeadingCalibrationDisplay))]
        #[unsafe(method_family = none)]
        pub unsafe fn dismissHeadingCalibrationDisplay(&self);

        #[unsafe(method(startMonitoringSignificantLocationChanges))]
        #[unsafe(method_family = none)]
        pub unsafe fn startMonitoringSignificantLocationChanges(&self);

        #[unsafe(method(stopMonitoringSignificantLocationChanges))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopMonitoringSignificantLocationChanges(&self);

        #[cfg(feature = "block2")]
        #[unsafe(method(startMonitoringLocationPushesWithCompletion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startMonitoringLocationPushesWithCompletion(
            &self,
            completion: Option<&block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>>,
        );

        #[unsafe(method(stopMonitoringLocationPushes))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopMonitoringLocationPushes(&self);

        #[cfg(all(feature = "CLLocation", feature = "CLRegion"))]
        #[deprecated]
        #[unsafe(method(startMonitoringForRegion:desiredAccuracy:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startMonitoringForRegion_desiredAccuracy(
            &self,
            region: &CLRegion,
            accuracy: CLLocationAccuracy,
        );

        #[cfg(feature = "CLRegion")]
        #[deprecated]
        #[unsafe(method(stopMonitoringForRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopMonitoringForRegion(&self, region: &CLRegion);

        #[cfg(feature = "CLRegion")]
        #[deprecated]
        #[unsafe(method(startMonitoringForRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startMonitoringForRegion(&self, region: &CLRegion);

        #[cfg(feature = "CLRegion")]
        #[deprecated]
        #[unsafe(method(requestStateForRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestStateForRegion(&self, region: &CLRegion);

        #[cfg(all(feature = "CLBeaconRegion", feature = "CLRegion"))]
        #[deprecated = "Use -startRangingBeaconsSatisfyingConstraint:"]
        #[unsafe(method(startRangingBeaconsInRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startRangingBeaconsInRegion(&self, region: &CLBeaconRegion);

        #[cfg(all(feature = "CLBeaconRegion", feature = "CLRegion"))]
        #[deprecated = "Use -stopRangingBeaconsSatisfyingConstraint:"]
        #[unsafe(method(stopRangingBeaconsInRegion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopRangingBeaconsInRegion(&self, region: &CLBeaconRegion);

        #[cfg(all(
            feature = "CLBeaconIdentityCondition",
            feature = "CLBeaconIdentityConstraint",
            feature = "CLCondition"
        ))]
        #[unsafe(method(startRangingBeaconsSatisfyingConstraint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startRangingBeaconsSatisfyingConstraint(
            &self,
            constraint: &CLBeaconIdentityConstraint,
        );

        #[cfg(all(
            feature = "CLBeaconIdentityCondition",
            feature = "CLBeaconIdentityConstraint",
            feature = "CLCondition"
        ))]
        #[unsafe(method(stopRangingBeaconsSatisfyingConstraint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopRangingBeaconsSatisfyingConstraint(
            &self,
            constraint: &CLBeaconIdentityConstraint,
        );

        #[cfg(feature = "CLLocation")]
        #[deprecated = "You can remove calls to this method"]
        #[unsafe(method(allowDeferredLocationUpdatesUntilTraveled:timeout:))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowDeferredLocationUpdatesUntilTraveled_timeout(
            &self,
            distance: CLLocationDistance,
            timeout: NSTimeInterval,
        );

        #[deprecated = "You can remove calls to this method"]
        #[unsafe(method(disallowDeferredLocationUpdates))]
        #[unsafe(method_family = none)]
        pub unsafe fn disallowDeferredLocationUpdates(&self);

        #[deprecated = "You can remove calls to this method"]
        #[unsafe(method(deferredLocationUpdatesAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn deferredLocationUpdatesAvailable() -> bool;

        #[cfg(all(feature = "CLLocation", feature = "block2"))]
        #[unsafe(method(requestHistoricalLocationsWithPurposeKey:sampleCount:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestHistoricalLocationsWithPurposeKey_sampleCount_completionHandler(
            &self,
            purpose_key: &NSString,
            sample_count: NSInteger,
            handler: &block2::DynBlock<dyn Fn(NonNull<NSArray<CLLocation>>, *mut NSError)>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl CLLocationManager {
    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>;
    );
}