objc2_health_kit/generated/
HKQuantitySample.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(HKSample, HKObject, NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 #[cfg(all(feature = "HKObject", feature = "HKSample"))]
16 pub struct HKQuantitySample;
17);
18
19#[cfg(all(feature = "HKObject", feature = "HKSample"))]
20unsafe impl Send for HKQuantitySample {}
21
22#[cfg(all(feature = "HKObject", feature = "HKSample"))]
23unsafe impl Sync for HKQuantitySample {}
24
25#[cfg(all(feature = "HKObject", feature = "HKSample"))]
26extern_conformance!(
27 unsafe impl NSCoding for HKQuantitySample {}
28);
29
30#[cfg(all(feature = "HKObject", feature = "HKSample"))]
31extern_conformance!(
32 unsafe impl NSObjectProtocol for HKQuantitySample {}
33);
34
35#[cfg(all(feature = "HKObject", feature = "HKSample"))]
36extern_conformance!(
37 unsafe impl NSSecureCoding for HKQuantitySample {}
38);
39
40#[cfg(all(feature = "HKObject", feature = "HKSample"))]
41impl HKQuantitySample {
42 extern_methods!(
43 #[cfg(feature = "HKObjectType")]
44 #[unsafe(method(quantityType))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn quantityType(&self) -> Retained<HKQuantityType>;
47
48 #[cfg(feature = "HKQuantity")]
49 #[unsafe(method(quantity))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn quantity(&self) -> Retained<HKQuantity>;
52
53 #[unsafe(method(count))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn count(&self) -> NSInteger;
59
60 #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
61 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate(
68 quantity_type: &HKQuantityType,
69 quantity: &HKQuantity,
70 start_date: &NSDate,
71 end_date: &NSDate,
72 ) -> Retained<Self>;
73
74 #[cfg(all(feature = "HKObjectType", feature = "HKQuantity"))]
75 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:metadata:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_metadata(
86 quantity_type: &HKQuantityType,
87 quantity: &HKQuantity,
88 start_date: &NSDate,
89 end_date: &NSDate,
90 metadata: Option<&NSDictionary<NSString, AnyObject>>,
91 ) -> Retained<Self>;
92
93 #[cfg(all(feature = "HKDevice", feature = "HKObjectType", feature = "HKQuantity"))]
94 #[unsafe(method(quantitySampleWithType:quantity:startDate:endDate:device:metadata:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn quantitySampleWithType_quantity_startDate_endDate_device_metadata(
115 quantity_type: &HKQuantityType,
116 quantity: &HKQuantity,
117 start_date: &NSDate,
118 end_date: &NSDate,
119 device: Option<&HKDevice>,
120 metadata: Option<&NSDictionary<NSString, AnyObject>>,
121 ) -> Retained<Self>;
122 );
123}
124
125#[cfg(all(feature = "HKObject", feature = "HKSample"))]
127impl HKQuantitySample {
128 extern_methods!(
129 #[unsafe(method(init))]
130 #[unsafe(method_family = init)]
131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132 );
133}
134
135#[cfg(all(feature = "HKObject", feature = "HKSample"))]
137impl HKQuantitySample {
138 extern_methods!(
139 #[unsafe(method(new))]
140 #[unsafe(method_family = new)]
141 pub unsafe fn new() -> Retained<Self>;
142 );
143}
144
145extern "C" {
146 pub static HKPredicateKeyPathQuantity: &'static NSString;
148}
149
150extern "C" {
151 pub static HKPredicateKeyPathCount: &'static NSString;
153}