objc2_health_kit/generated/
HKDiscreteQuantitySample.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(HKQuantitySample, HKSample, HKObject, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(
17 feature = "HKObject",
18 feature = "HKQuantitySample",
19 feature = "HKSample"
20 ))]
21 pub struct HKDiscreteQuantitySample;
22);
23
24#[cfg(all(
25 feature = "HKObject",
26 feature = "HKQuantitySample",
27 feature = "HKSample"
28))]
29unsafe impl Send for HKDiscreteQuantitySample {}
30
31#[cfg(all(
32 feature = "HKObject",
33 feature = "HKQuantitySample",
34 feature = "HKSample"
35))]
36unsafe impl Sync for HKDiscreteQuantitySample {}
37
38#[cfg(all(
39 feature = "HKObject",
40 feature = "HKQuantitySample",
41 feature = "HKSample"
42))]
43extern_conformance!(
44 unsafe impl NSCoding for HKDiscreteQuantitySample {}
45);
46
47#[cfg(all(
48 feature = "HKObject",
49 feature = "HKQuantitySample",
50 feature = "HKSample"
51))]
52extern_conformance!(
53 unsafe impl NSObjectProtocol for HKDiscreteQuantitySample {}
54);
55
56#[cfg(all(
57 feature = "HKObject",
58 feature = "HKQuantitySample",
59 feature = "HKSample"
60))]
61extern_conformance!(
62 unsafe impl NSSecureCoding for HKDiscreteQuantitySample {}
63);
64
65#[cfg(all(
66 feature = "HKObject",
67 feature = "HKQuantitySample",
68 feature = "HKSample"
69))]
70impl HKDiscreteQuantitySample {
71 extern_methods!(
72 #[cfg(feature = "HKQuantity")]
73 #[unsafe(method(minimumQuantity))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn minimumQuantity(&self) -> Retained<HKQuantity>;
77
78 #[cfg(feature = "HKQuantity")]
79 #[unsafe(method(averageQuantity))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn averageQuantity(&self) -> Retained<HKQuantity>;
83
84 #[cfg(feature = "HKQuantity")]
85 #[unsafe(method(maximumQuantity))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn maximumQuantity(&self) -> Retained<HKQuantity>;
89
90 #[cfg(feature = "HKQuantity")]
91 #[unsafe(method(mostRecentQuantity))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn mostRecentQuantity(&self) -> Retained<HKQuantity>;
95
96 #[unsafe(method(mostRecentQuantityDateInterval))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn mostRecentQuantityDateInterval(&self) -> Retained<NSDateInterval>;
100 );
101}
102
103#[cfg(all(
105 feature = "HKObject",
106 feature = "HKQuantitySample",
107 feature = "HKSample"
108))]
109impl HKDiscreteQuantitySample {
110 extern_methods!(
111 #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
112 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate(
119 quantity_type: &HKQuantityType,
120 quantity: &HKQuantity,
121 start_date: &NSDate,
122 end_date: &NSDate,
123 ) -> Retained<Self>;
124
125 #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
126 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:metadata:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_metadata(
137 quantity_type: &HKQuantityType,
138 quantity: &HKQuantity,
139 start_date: &NSDate,
140 end_date: &NSDate,
141 metadata: Option<&NSDictionary<NSString, AnyObject>>,
142 ) -> Retained<Self>;
143
144 #[cfg(all(feature = "HKDevice", feature = "HKObjectType", feature = "HKQuantity"))]
145 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:device:metadata:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_device_metadata(
166 quantity_type: &HKQuantityType,
167 quantity: &HKQuantity,
168 start_date: &NSDate,
169 end_date: &NSDate,
170 device: Option<&HKDevice>,
171 metadata: Option<&NSDictionary<NSString, AnyObject>>,
172 ) -> Retained<Self>;
173 );
174}
175
176#[cfg(all(
178 feature = "HKObject",
179 feature = "HKQuantitySample",
180 feature = "HKSample"
181))]
182impl HKDiscreteQuantitySample {
183 extern_methods!(
184 #[unsafe(method(init))]
185 #[unsafe(method_family = init)]
186 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
187 );
188}
189
190#[cfg(all(
192 feature = "HKObject",
193 feature = "HKQuantitySample",
194 feature = "HKSample"
195))]
196impl HKDiscreteQuantitySample {
197 extern_methods!(
198 #[unsafe(method(new))]
199 #[unsafe(method_family = new)]
200 pub unsafe fn new() -> Retained<Self>;
201 );
202}
203
204extern "C" {
205 pub static HKPredicateKeyPathMin: &'static NSString;
207}
208
209extern "C" {
210 pub static HKPredicateKeyPathAverage: &'static NSString;
212}
213
214extern "C" {
215 pub static HKPredicateKeyPathMax: &'static NSString;
217}
218
219extern "C" {
220 pub static HKPredicateKeyPathMostRecent: &'static NSString;
222}
223
224extern "C" {
225 pub static HKPredicateKeyPathMostRecentStartDate: &'static NSString;
227}
228
229extern "C" {
230 pub static HKPredicateKeyPathMostRecentEndDate: &'static NSString;
232}
233
234extern "C" {
235 pub static HKPredicateKeyPathMostRecentDuration: &'static NSString;
237}