objc2_audio_toolbox/generated/
AUParameters.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
10/// A value of an audio unit parameter.
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auvalue?language=objc)
13pub type AUValue = c_float;
14
15/// Numeric identifier for audio unit parameter.
16///
17/// Note that parameter addresses are not necessarily persistent, unless the individual audio
18/// unit documents a promise to maintain its addressing scheme. Hosts should bind to parameters'
19/// key paths.
20///
21/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameteraddress?language=objc)
22pub type AUParameterAddress = u64;
23
24/// Identifies the different types of parameter automation events.
25///
26///
27/// Audio Units may generate parameter changes from their user interfaces. Hosts may attach
28/// significance to the beginning and end of a UI gesture (typically touching and releasing
29/// a fader). These gestures are conveyed through these types of automation events.
30///
31///
32/// The event contains an updated value for the parameter.
33///
34/// The event marks an initial "touch" gesture on a UI element.
35///
36/// The event marks a final "release" gesture on a UI element.
37///
38/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterautomationeventtype?language=objc)
39// NS_ENUM
40#[repr(transparent)]
41#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
42pub struct AUParameterAutomationEventType(pub u32);
43impl AUParameterAutomationEventType {
44    #[doc(alias = "AUParameterAutomationEventTypeValue")]
45    pub const Value: Self = Self(0);
46    #[doc(alias = "AUParameterAutomationEventTypeTouch")]
47    pub const Touch: Self = Self(1);
48    #[doc(alias = "AUParameterAutomationEventTypeRelease")]
49    pub const Release: Self = Self(2);
50}
51
52unsafe impl Encode for AUParameterAutomationEventType {
53    const ENCODING: Encoding = u32::ENCODING;
54}
55
56unsafe impl RefEncode for AUParameterAutomationEventType {
57    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60/// An event recording the changing of a parameter at a particular host time.
61///
62/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/aurecordedparameterevent?language=objc)
63#[repr(C)]
64#[derive(Clone, Copy, Debug, PartialEq)]
65pub struct AURecordedParameterEvent {
66    /// The host time at which the event occurred.
67    pub hostTime: u64,
68    /// The address of the parameter whose value changed.
69    pub address: AUParameterAddress,
70    /// The value of the parameter at that time.
71    pub value: AUValue,
72}
73
74unsafe impl Encode for AURecordedParameterEvent {
75    const ENCODING: Encoding = Encoding::Struct(
76        "AURecordedParameterEvent",
77        &[
78            <u64>::ENCODING,
79            <AUParameterAddress>::ENCODING,
80            <AUValue>::ENCODING,
81        ],
82    );
83}
84
85unsafe impl RefEncode for AURecordedParameterEvent {
86    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
87}
88
89/// An event recording the changing of a parameter, possibly including events
90/// such as touch and release gestures, at a particular host time.
91///
92/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterautomationevent?language=objc)
93#[repr(C)]
94#[derive(Clone, Copy, Debug, PartialEq)]
95pub struct AUParameterAutomationEvent {
96    /// The host time at which the event occurred.
97    pub hostTime: u64,
98    /// The address of the parameter whose value changed.
99    pub address: AUParameterAddress,
100    /// The value of the parameter at that time.
101    pub value: AUValue,
102    /// The type of the event.
103    pub eventType: AUParameterAutomationEventType,
104    pub reserved: u64,
105}
106
107unsafe impl Encode for AUParameterAutomationEvent {
108    const ENCODING: Encoding = Encoding::Struct(
109        "AUParameterAutomationEvent",
110        &[
111            <u64>::ENCODING,
112            <AUParameterAddress>::ENCODING,
113            <AUValue>::ENCODING,
114            <AUParameterAutomationEventType>::ENCODING,
115            <u64>::ENCODING,
116        ],
117    );
118}
119
120unsafe impl RefEncode for AUParameterAutomationEvent {
121    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
122}
123
124/// A block called to signal that the value of a parameter has changed.
125///
126/// See the discussion of -[AUParameterNode tokenByAddingParameterObserver:].
127///
128/// Parameter `address`: The address of the parameter whose value changed.
129///
130/// Parameter `value`: The current value of the parameter.
131///
132/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterobserver?language=objc)
133#[cfg(feature = "block2")]
134pub type AUParameterObserver = *mut block2::DynBlock<dyn Fn(AUParameterAddress, AUValue)>;
135
136/// A block called to record parameter changes as automation events.
137///
138/// See the discussion of -[AUParameterNode tokenByAddingParameterRecordingObserver:].
139///
140/// Parameter `numberEvents`: The number of events being delivered.
141///
142/// Parameter `events`: The events being delivered.
143///
144/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterrecordingobserver?language=objc)
145#[cfg(feature = "block2")]
146pub type AUParameterRecordingObserver =
147    *mut block2::DynBlock<dyn Fn(NSInteger, NonNull<AURecordedParameterEvent>)>;
148
149/// A block called to record parameter changes as automation events.
150///
151/// See the discussion of -[AUParameterNode tokenByAddingParameterAutomationObserver:].
152///
153/// Parameter `numberEvents`: The number of events being delivered.
154///
155/// Parameter `events`: The events being delivered.
156///
157/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterautomationobserver?language=objc)
158#[cfg(feature = "block2")]
159pub type AUParameterAutomationObserver =
160    *mut block2::DynBlock<dyn Fn(NSInteger, NonNull<AUParameterAutomationEvent>)>;
161
162/// A token representing an installed AUParameterObserver, AUParameterRecordingObserver,
163/// or AUParameterAutomationObserver.
164///
165/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameterobservertoken?language=objc)
166pub type AUParameterObserverToken = *mut c_void;
167
168extern_class!(
169    /// A node in an audio unit's tree of parameters.
170    ///
171    /// Nodes are instances of either AUParameterGroup or AUParameter.
172    ///
173    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameternode?language=objc)
174    #[unsafe(super(NSObject))]
175    #[derive(Debug, PartialEq, Eq, Hash)]
176    pub struct AUParameterNode;
177);
178
179extern_conformance!(
180    unsafe impl NSObjectProtocol for AUParameterNode {}
181);
182
183impl AUParameterNode {
184    extern_methods!(
185        /// A non-localized, permanent name for a parameter or group.
186        ///
187        /// The identifier must be unique for all child nodes under any given parent. From release to
188        /// release, an audio unit must not change its parameters' identifiers; this will invalidate any
189        /// hosts' documents that refer to the parameters.
190        #[unsafe(method(identifier))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn identifier(&self) -> Retained<NSString>;
193
194        /// Generated by concatenating the identifiers of a node's parents with its own.
195        ///
196        /// Unless an audio unit specifically documents that its parameter addresses are stable and
197        /// persistent, hosts, when recording parameter values, should bind to the keyPath.
198        ///
199        /// The individual node identifiers in a key path are separated by periods. (".")
200        ///
201        /// Passing a node's keyPath to -[tree valueForKeyPath:] should return the same node.
202        #[unsafe(method(keyPath))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn keyPath(&self) -> Retained<NSString>;
205
206        /// A localized name to display for the parameter.
207        #[unsafe(method(displayName))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn displayName(&self) -> Retained<NSString>;
210
211        /// A version of displayName possibly abbreviated to the given desired length, in characters.
212        ///
213        /// The default implementation simply returns displayName.
214        #[unsafe(method(displayNameWithLength:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn displayNameWithLength(&self, maximum_length: NSInteger)
217            -> Retained<NSString>;
218
219        #[cfg(feature = "block2")]
220        /// Add an observer for a parameter or all parameters in a group/tree.
221        ///
222        /// An audio unit view can use an AUParameterObserver to be notified of changes
223        /// to a single parameter, or to all parameters in a group/tree.
224        ///
225        /// These callbacks are throttled so as to limit the rate of redundant notifications
226        /// in the case of frequent changes to a single parameter.
227        ///
228        /// This block is called in an arbitrary thread context. It is responsible for thread-safety.
229        /// It must not make any calls to add or remove other observers, including itself;
230        /// this will deadlock.
231        ///
232        /// An audio unit's implementation should interact with the parameter object via
233        /// implementorValueObserver and implementorValueProvider.
234        ///
235        /// Parameter observers are bound to a specific parameter instance. If this parameter is
236        /// destroyed, e.g. if the parameter tree is re-constructed, the previously set parameter
237        /// observers will no longer be valid. Clients can observe changes to the parameter tree
238        /// via KVO. See the discussion of -[AUAudioUnit parameterTree].
239        ///
240        /// Parameter `observer`: A block to call after the value of a parameter has changed.
241        ///
242        /// Returns: A token which can be passed to removeParameterObserver: or to -[AUParameter setValue:originator:]
243        ///
244        /// # Safety
245        ///
246        /// `observer` must be a valid pointer.
247        #[unsafe(method(tokenByAddingParameterObserver:))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn tokenByAddingParameterObserver(
250            &self,
251            observer: AUParameterObserver,
252        ) -> AUParameterObserverToken;
253
254        #[cfg(feature = "block2")]
255        /// Add a recording observer for a parameter or all parameters in a group/tree.
256        ///
257        /// This is a variant of tokenByAddingParameterAutomationObserver where the callback receives
258        /// AURecordedParameterEvents instead of AUParameterAutomationEvents.
259        ///
260        /// This will be deprecated in favor of tokenByAddingParameterAutomationObserver in a future
261        /// release.
262        ///
263        /// # Safety
264        ///
265        /// `observer` must be a valid pointer.
266        #[unsafe(method(tokenByAddingParameterRecordingObserver:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn tokenByAddingParameterRecordingObserver(
269            &self,
270            observer: AUParameterRecordingObserver,
271        ) -> AUParameterObserverToken;
272
273        #[cfg(feature = "block2")]
274        /// Add a recording observer for a parameter or all parameters in a group/tree.
275        ///
276        /// An audio unit host can use an AUParameterAutomationObserver or AUParameterRecordingObserver
277        /// to capture a series of changes to a parameter value, including the timing of the events, as
278        /// generated by a UI gesture in a view, for example.
279        ///
280        /// Unlike AUParameterObserver, these callbacks are not throttled.
281        ///
282        /// This block is called in an arbitrary thread context. It is responsible for thread-safety.
283        /// It must not make any calls to add or remove other observers, including itself;
284        /// this will deadlock.
285        ///
286        /// An audio unit's engine should interact with the parameter object via
287        /// implementorValueObserver and implementorValueProvider.
288        ///
289        /// Parameter `observer`: A block to call to record the changing of a parameter value.
290        ///
291        /// Returns: A token which can be passed to removeParameterObserver: or to -[AUParameter
292        /// setValue:originator:]
293        ///
294        /// # Safety
295        ///
296        /// `observer` must be a valid pointer.
297        #[unsafe(method(tokenByAddingParameterAutomationObserver:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn tokenByAddingParameterAutomationObserver(
300            &self,
301            observer: AUParameterAutomationObserver,
302        ) -> AUParameterObserverToken;
303
304        /// Remove an observer created with tokenByAddingParameterObserver,
305        /// tokenByAddingParameterRecordingObserver, or tokenByAddingParameterAutomationObserver.
306        ///
307        /// This call will remove the callback corresponding to the supplied token. Note that this
308        /// will block until any callbacks currently in flight have completed.
309        ///
310        /// # Safety
311        ///
312        /// `token` must be a valid pointer.
313        #[unsafe(method(removeParameterObserver:))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn removeParameterObserver(&self, token: AUParameterObserverToken);
316    );
317}
318
319/// Methods declared on superclass `NSObject`.
320impl AUParameterNode {
321    extern_methods!(
322        #[unsafe(method(init))]
323        #[unsafe(method_family = init)]
324        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
325
326        #[unsafe(method(new))]
327        #[unsafe(method_family = new)]
328        pub unsafe fn new() -> Retained<Self>;
329    );
330}
331
332extern_class!(
333    /// A group of related parameters.
334    ///
335    /// A parameter group is KVC-compliant for its children; e.g. valueForKey:
336    /// "
337    /// volume" will
338    /// return a child parameter whose identifier is "volume".
339    ///
340    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparametergroup?language=objc)
341    #[unsafe(super(AUParameterNode, NSObject))]
342    #[derive(Debug, PartialEq, Eq, Hash)]
343    pub struct AUParameterGroup;
344);
345
346extern_conformance!(
347    unsafe impl NSCoding for AUParameterGroup {}
348);
349
350extern_conformance!(
351    unsafe impl NSObjectProtocol for AUParameterGroup {}
352);
353
354extern_conformance!(
355    unsafe impl NSSecureCoding for AUParameterGroup {}
356);
357
358impl AUParameterGroup {
359    extern_methods!(
360        /// The group's child nodes (AUParameterGroupNode).
361        #[unsafe(method(children))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn children(&self) -> Retained<NSArray<AUParameterNode>>;
364
365        /// Returns a flat array of all parameters in the group, including those in child groups.
366        #[unsafe(method(allParameters))]
367        #[unsafe(method_family = none)]
368        pub unsafe fn allParameters(&self) -> Retained<NSArray<AUParameter>>;
369    );
370}
371
372/// Methods declared on superclass `NSObject`.
373impl AUParameterGroup {
374    extern_methods!(
375        #[unsafe(method(init))]
376        #[unsafe(method_family = init)]
377        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
378
379        #[unsafe(method(new))]
380        #[unsafe(method_family = new)]
381        pub unsafe fn new() -> Retained<Self>;
382    );
383}
384
385extern_class!(
386    /// The top level group node, representing all of an audio unit's parameters.
387    ///
388    /// An audio unit's parameters are organized into a tree containing groups and parameters.
389    /// Groups may be nested.
390    ///
391    /// The tree is KVO-compliant. For example, if the tree contains a group named "LFO" ,
392    /// containing a parameter named rate, then "LFO.rate" refers to that parameter object, and
393    /// "LFO.rate.value" refers to that parameter's value.
394    ///
395    /// An audio unit may choose to dynamically rearrange the tree. When doing so, it must
396    /// issue a KVO notification on the audio unit's parameterTree property. The tree's elements are
397    /// mostly immutable (except for values and implementor hooks); the only way to modify them
398    /// is to publish a new tree.
399    ///
400    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparametertree?language=objc)
401    #[unsafe(super(AUParameterGroup, AUParameterNode, NSObject))]
402    #[derive(Debug, PartialEq, Eq, Hash)]
403    pub struct AUParameterTree;
404);
405
406extern_conformance!(
407    unsafe impl NSCoding for AUParameterTree {}
408);
409
410extern_conformance!(
411    unsafe impl NSObjectProtocol for AUParameterTree {}
412);
413
414extern_conformance!(
415    unsafe impl NSSecureCoding for AUParameterTree {}
416);
417
418impl AUParameterTree {
419    extern_methods!(
420        /// Search a tree for a parameter with a specific address.
421        ///
422        /// Returns: The parameter corresponding to the supplied address, or nil if no such parameter exists.
423        #[unsafe(method(parameterWithAddress:))]
424        #[unsafe(method_family = none)]
425        pub unsafe fn parameterWithAddress(
426            &self,
427            address: AUParameterAddress,
428        ) -> Option<Retained<AUParameter>>;
429
430        #[cfg(feature = "AUComponent")]
431        /// Search a tree for a specific v2 audio unit parameter.
432        ///
433        /// V2 audio units publish parameters identified by a parameter ID, scope, and element.
434        /// A host that knows that it is dealing with a v2 unit can locate parameters using this method,
435        /// for example, for the Apple-supplied system audio units.
436        ///
437        /// Returns: The parameter corresponding to the supplied ID/scope/element, or nil if no such parameter
438        /// exists, or if the audio unit is not a v2 unit.
439        #[unsafe(method(parameterWithID:scope:element:))]
440        #[unsafe(method_family = none)]
441        pub unsafe fn parameterWithID_scope_element(
442            &self,
443            param_id: AudioUnitParameterID,
444            scope: AudioUnitScope,
445            element: AudioUnitElement,
446        ) -> Option<Retained<AUParameter>>;
447    );
448}
449
450/// Methods declared on superclass `NSObject`.
451impl AUParameterTree {
452    extern_methods!(
453        #[unsafe(method(init))]
454        #[unsafe(method_family = init)]
455        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
456
457        #[unsafe(method(new))]
458        #[unsafe(method_family = new)]
459        pub unsafe fn new() -> Retained<Self>;
460    );
461}
462
463extern_class!(
464    /// A node representing a single parameter.
465    ///
466    /// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/auparameter?language=objc)
467    #[unsafe(super(AUParameterNode, NSObject))]
468    #[derive(Debug, PartialEq, Eq, Hash)]
469    pub struct AUParameter;
470);
471
472extern_conformance!(
473    unsafe impl NSCoding for AUParameter {}
474);
475
476extern_conformance!(
477    unsafe impl NSObjectProtocol for AUParameter {}
478);
479
480extern_conformance!(
481    unsafe impl NSSecureCoding for AUParameter {}
482);
483
484impl AUParameter {
485    extern_methods!(
486        /// The parameter's minimum value.
487        #[unsafe(method(minValue))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn minValue(&self) -> AUValue;
490
491        /// The parameter's maximum value.
492        #[unsafe(method(maxValue))]
493        #[unsafe(method_family = none)]
494        pub unsafe fn maxValue(&self) -> AUValue;
495
496        #[cfg(feature = "AudioUnitProperties")]
497        /// The parameter's unit of measurement.
498        #[unsafe(method(unit))]
499        #[unsafe(method_family = none)]
500        pub unsafe fn unit(&self) -> AudioUnitParameterUnit;
501
502        /// A localized name for the parameter's unit. Supplied by the AU if kAudioUnitParameterUnit_CustomUnit; else by the framework.
503        #[unsafe(method(unitName))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn unitName(&self) -> Option<Retained<NSString>>;
506
507        #[cfg(feature = "AudioUnitProperties")]
508        /// Various details of the parameter.
509        #[unsafe(method(flags))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn flags(&self) -> AudioUnitParameterOptions;
512
513        /// The parameter's address.
514        #[unsafe(method(address))]
515        #[unsafe(method_family = none)]
516        pub unsafe fn address(&self) -> AUParameterAddress;
517
518        /// For parameters with kAudioUnitParameterUnit_Indexed, localized strings corresponding
519        /// to the values.
520        #[unsafe(method(valueStrings))]
521        #[unsafe(method_family = none)]
522        pub unsafe fn valueStrings(&self) -> Option<Retained<NSArray<NSString>>>;
523
524        /// Parameters whose values may change as a side effect of this parameter's value
525        /// changing.
526        ///
527        /// Each array value is an NSNumber representing AUParameterAddress.
528        #[unsafe(method(dependentParameters))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn dependentParameters(&self) -> Option<Retained<NSArray<NSNumber>>>;
531
532        /// The parameter's current value.
533        #[unsafe(method(value))]
534        #[unsafe(method_family = none)]
535        pub unsafe fn value(&self) -> AUValue;
536
537        /// Setter for [`value`][Self::value].
538        #[unsafe(method(setValue:))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn setValue(&self, value: AUValue);
541
542        /// Set the parameter's value, avoiding redundant notifications to the originator.
543        ///
544        /// Bridged to the v2 function AudioUnitSetParameter.
545        ///
546        /// # Safety
547        ///
548        /// `originator` must be a valid pointer or null.
549        #[unsafe(method(setValue:originator:))]
550        #[unsafe(method_family = none)]
551        pub unsafe fn setValue_originator(
552            &self,
553            value: AUValue,
554            originator: AUParameterObserverToken,
555        );
556
557        /// Convenience for setValue:originator:atHostTime:eventType:
558        ///
559        /// Bridged to the v2 function AudioUnitSetParameter.
560        ///
561        /// # Safety
562        ///
563        /// `originator` must be a valid pointer or null.
564        #[unsafe(method(setValue:originator:atHostTime:))]
565        #[unsafe(method_family = none)]
566        pub unsafe fn setValue_originator_atHostTime(
567            &self,
568            value: AUValue,
569            originator: AUParameterObserverToken,
570            host_time: u64,
571        );
572
573        /// Set the parameter's value, preserving the host time of the gesture that initiated the
574        /// change, and associating an event type such as touch/release.
575        ///
576        /// In general, this method should only be called from a user interface. It initiates a change
577        /// to a parameter in a way that captures the gesture such that it can be recorded later --
578        /// any AUParameterAutomationObservers will receive the host time and event type associated
579        /// with the parameter change.
580        ///
581        /// From an audio playback engine, a host should schedule automated parameter changes through
582        /// AUAudioUnit's scheduleParameterBlock.
583        ///
584        /// Bridged to the v2 function AudioUnitSetParameter.
585        ///
586        /// # Safety
587        ///
588        /// `originator` must be a valid pointer or null.
589        #[unsafe(method(setValue:originator:atHostTime:eventType:))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn setValue_originator_atHostTime_eventType(
592            &self,
593            value: AUValue,
594            originator: AUParameterObserverToken,
595            host_time: u64,
596            event_type: AUParameterAutomationEventType,
597        );
598
599        /// Get a textual representation of a value for the parameter. Use value==nil to use the
600        /// current value. Bridged to the v2 property kAudioUnitProperty_ParameterStringFromValue.
601        ///
602        /// This is currently only supported for parameters whose flags include
603        /// kAudioUnitParameterFlag_ValuesHaveStrings.
604        ///
605        /// # Safety
606        ///
607        /// `value` must be a valid pointer or null.
608        #[unsafe(method(stringFromValue:))]
609        #[unsafe(method_family = none)]
610        pub unsafe fn stringFromValue(&self, value: *const AUValue) -> Retained<NSString>;
611
612        /// Convert a textual representation of a value to a numeric one.
613        ///
614        /// This is currently only supported for parameters whose flags include
615        /// kAudioUnitParameterFlag_ValuesHaveStrings.
616        #[unsafe(method(valueFromString:))]
617        #[unsafe(method_family = none)]
618        pub unsafe fn valueFromString(&self, string: &NSString) -> AUValue;
619    );
620}
621
622/// Methods declared on superclass `NSObject`.
623impl AUParameter {
624    extern_methods!(
625        #[unsafe(method(init))]
626        #[unsafe(method_family = init)]
627        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
628
629        #[unsafe(method(new))]
630        #[unsafe(method_family = new)]
631        pub unsafe fn new() -> Retained<Self>;
632    );
633}