objc2_health_kit/generated/
HKElectrocardiogramQuery.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
10extern_class!(
11    /// An HKElectrocardiogramVoltageMeasurement contains voltage quantities for all leads at a single instance of measurement.
12    ///
13    /// Each HKElectrocardiogramVoltageMeasurement object corresponds to the voltage quantities across all leads for a given instance in time.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkelectrocardiogramvoltagemeasurement?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct HKElectrocardiogramVoltageMeasurement;
19);
20
21unsafe impl Send for HKElectrocardiogramVoltageMeasurement {}
22
23unsafe impl Sync for HKElectrocardiogramVoltageMeasurement {}
24
25extern_conformance!(
26    unsafe impl NSCopying for HKElectrocardiogramVoltageMeasurement {}
27);
28
29unsafe impl CopyingHelper for HKElectrocardiogramVoltageMeasurement {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for HKElectrocardiogramVoltageMeasurement {}
35);
36
37impl HKElectrocardiogramVoltageMeasurement {
38    extern_methods!(
39        /// The time interval between this voltage measurement and the start of the sample.
40        ///
41        /// This property is not atomic.
42        ///
43        /// # Safety
44        ///
45        /// This might not be thread-safe.
46        #[unsafe(method(timeSinceSampleStart))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn timeSinceSampleStart(&self) -> NSTimeInterval;
49
50        #[cfg(all(feature = "HKElectrocardiogram", feature = "HKQuantity"))]
51        /// Returns an HKQuantity for the specified lead with a unit compatible with [HKUnit voltUnit].
52        ///
53        /// Parameter `lead`: The HKElectrocardiogramLead for which voltage quantity will be returned.
54        #[unsafe(method(quantityForLead:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn quantityForLead(
57            &self,
58            lead: HKElectrocardiogramLead,
59        ) -> Option<Retained<HKQuantity>>;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl HKElectrocardiogramVoltageMeasurement {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}
75
76extern_class!(
77    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkelectrocardiogramquery?language=objc)
78    #[unsafe(super(HKQuery, NSObject))]
79    #[derive(Debug, PartialEq, Eq, Hash)]
80    #[cfg(feature = "HKQuery")]
81    pub struct HKElectrocardiogramQuery;
82);
83
84#[cfg(feature = "HKQuery")]
85unsafe impl Send for HKElectrocardiogramQuery {}
86
87#[cfg(feature = "HKQuery")]
88unsafe impl Sync for HKElectrocardiogramQuery {}
89
90#[cfg(feature = "HKQuery")]
91extern_conformance!(
92    unsafe impl NSObjectProtocol for HKElectrocardiogramQuery {}
93);
94
95#[cfg(feature = "HKQuery")]
96impl HKElectrocardiogramQuery {
97    extern_methods!(
98        #[cfg(all(
99            feature = "HKElectrocardiogram",
100            feature = "HKObject",
101            feature = "HKSample",
102            feature = "block2"
103        ))]
104        /// Returns a query that will enumerate over voltages recorded across leads in
105        /// an electrocardiogram.
106        ///
107        ///
108        /// Parameter `electrocardiogram`: The sample for which the lead data will be returned.
109        ///
110        /// Parameter `dataHandler`: The block to invoke with results from the query. It will be called once for each voltage measurement. Call [query stop] to stop enumeration, if desired.
111        #[unsafe(method(initWithElectrocardiogram:dataHandler:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithElectrocardiogram_dataHandler(
114            this: Allocated<Self>,
115            electrocardiogram: &HKElectrocardiogram,
116            data_handler: &block2::DynBlock<
117                dyn Fn(
118                    NonNull<HKElectrocardiogramQuery>,
119                    *mut HKElectrocardiogramVoltageMeasurement,
120                    Bool,
121                    *mut NSError,
122                ),
123            >,
124        ) -> Retained<Self>;
125    );
126}
127
128/// Methods declared on superclass `HKQuery`.
129#[cfg(feature = "HKQuery")]
130impl HKElectrocardiogramQuery {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135    );
136}
137
138/// Methods declared on superclass `NSObject`.
139#[cfg(feature = "HKQuery")]
140impl HKElectrocardiogramQuery {
141    extern_methods!(
142        #[unsafe(method(new))]
143        #[unsafe(method_family = new)]
144        pub unsafe fn new() -> Retained<Self>;
145    );
146}