objc2_health_kit/generated/
HKElectrocardiogram.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct HKElectrocardiogramLead(pub NSInteger);
18impl HKElectrocardiogramLead {
19 #[doc(alias = "HKElectrocardiogramLeadAppleWatchSimilarToLeadI")]
20 pub const AppleWatchSimilarToLeadI: Self = Self(1);
21}
22
23unsafe impl Encode for HKElectrocardiogramLead {
24 const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for HKElectrocardiogramLead {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31#[repr(transparent)]
36#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
37pub struct HKElectrocardiogramClassification(pub NSInteger);
38impl HKElectrocardiogramClassification {
39 #[doc(alias = "HKElectrocardiogramClassificationNotSet")]
40 pub const NotSet: Self = Self(0);
41 #[doc(alias = "HKElectrocardiogramClassificationSinusRhythm")]
42 pub const SinusRhythm: Self = Self(1);
43 #[doc(alias = "HKElectrocardiogramClassificationAtrialFibrillation")]
44 pub const AtrialFibrillation: Self = Self(2);
45 #[doc(alias = "HKElectrocardiogramClassificationInconclusiveLowHeartRate")]
46 pub const InconclusiveLowHeartRate: Self = Self(3);
47 #[doc(alias = "HKElectrocardiogramClassificationInconclusiveHighHeartRate")]
48 pub const InconclusiveHighHeartRate: Self = Self(4);
49 #[doc(alias = "HKElectrocardiogramClassificationInconclusivePoorReading")]
50 pub const InconclusivePoorReading: Self = Self(5);
51 #[doc(alias = "HKElectrocardiogramClassificationInconclusiveOther")]
52 pub const InconclusiveOther: Self = Self(6);
53 #[doc(alias = "HKElectrocardiogramClassificationUnrecognized")]
54 pub const Unrecognized: Self = Self(100);
55}
56
57unsafe impl Encode for HKElectrocardiogramClassification {
58 const ENCODING: Encoding = NSInteger::ENCODING;
59}
60
61unsafe impl RefEncode for HKElectrocardiogramClassification {
62 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
63}
64
65#[repr(transparent)]
76#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
77pub struct HKElectrocardiogramSymptomsStatus(pub NSInteger);
78impl HKElectrocardiogramSymptomsStatus {
79 #[doc(alias = "HKElectrocardiogramSymptomsStatusNotSet")]
80 pub const NotSet: Self = Self(0);
81 #[doc(alias = "HKElectrocardiogramSymptomsStatusNone")]
82 pub const None: Self = Self(1);
83 #[doc(alias = "HKElectrocardiogramSymptomsStatusPresent")]
84 pub const Present: Self = Self(2);
85}
86
87unsafe impl Encode for HKElectrocardiogramSymptomsStatus {
88 const ENCODING: Encoding = NSInteger::ENCODING;
89}
90
91unsafe impl RefEncode for HKElectrocardiogramSymptomsStatus {
92 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
93}
94
95extern_class!(
96 #[unsafe(super(HKSample, HKObject, NSObject))]
101 #[derive(Debug, PartialEq, Eq, Hash)]
102 #[cfg(all(feature = "HKObject", feature = "HKSample"))]
103 pub struct HKElectrocardiogram;
104);
105
106#[cfg(all(feature = "HKObject", feature = "HKSample"))]
107unsafe impl Send for HKElectrocardiogram {}
108
109#[cfg(all(feature = "HKObject", feature = "HKSample"))]
110unsafe impl Sync for HKElectrocardiogram {}
111
112#[cfg(all(feature = "HKObject", feature = "HKSample"))]
113extern_conformance!(
114 unsafe impl NSCoding for HKElectrocardiogram {}
115);
116
117#[cfg(all(feature = "HKObject", feature = "HKSample"))]
118extern_conformance!(
119 unsafe impl NSObjectProtocol for HKElectrocardiogram {}
120);
121
122#[cfg(all(feature = "HKObject", feature = "HKSample"))]
123extern_conformance!(
124 unsafe impl NSSecureCoding for HKElectrocardiogram {}
125);
126
127#[cfg(all(feature = "HKObject", feature = "HKSample"))]
128impl HKElectrocardiogram {
129 extern_methods!(
130 #[unsafe(method(numberOfVoltageMeasurements))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn numberOfVoltageMeasurements(&self) -> NSInteger;
140
141 #[cfg(feature = "HKQuantity")]
142 #[unsafe(method(samplingFrequency))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn samplingFrequency(&self) -> Option<Retained<HKQuantity>>;
152
153 #[unsafe(method(classification))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn classification(&self) -> HKElectrocardiogramClassification;
163
164 #[cfg(feature = "HKQuantity")]
165 #[unsafe(method(averageHeartRate))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn averageHeartRate(&self) -> Option<Retained<HKQuantity>>;
175
176 #[unsafe(method(symptomsStatus))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn symptomsStatus(&self) -> HKElectrocardiogramSymptomsStatus;
186 );
187}
188
189#[cfg(all(feature = "HKObject", feature = "HKSample"))]
191impl HKElectrocardiogram {
192 extern_methods!(
193 #[unsafe(method(init))]
194 #[unsafe(method_family = init)]
195 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
196 );
197}
198
199#[cfg(all(feature = "HKObject", feature = "HKSample"))]
201impl HKElectrocardiogram {
202 extern_methods!(
203 #[unsafe(method(new))]
204 #[unsafe(method_family = new)]
205 pub unsafe fn new() -> Retained<Self>;
206 );
207}
208
209extern "C" {
210 pub static HKPredicateKeyPathAverageHeartRate: &'static NSString;
212}
213
214extern "C" {
215 pub static HKPredicateKeyPathECGClassification: &'static NSString;
217}
218
219extern "C" {
220 pub static HKPredicateKeyPathECGSymptomsStatus: &'static NSString;
222}