objc2_health_kit/generated/
HKSample.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// An abstract class representing measurements taken over a period of time.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksample?language=objc)
13    #[unsafe(super(HKObject, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "HKObject")]
16    pub struct HKSample;
17);
18
19#[cfg(feature = "HKObject")]
20unsafe impl Send for HKSample {}
21
22#[cfg(feature = "HKObject")]
23unsafe impl Sync for HKSample {}
24
25#[cfg(feature = "HKObject")]
26extern_conformance!(
27    unsafe impl NSCoding for HKSample {}
28);
29
30#[cfg(feature = "HKObject")]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for HKSample {}
33);
34
35#[cfg(feature = "HKObject")]
36extern_conformance!(
37    unsafe impl NSSecureCoding for HKSample {}
38);
39
40#[cfg(feature = "HKObject")]
41impl HKSample {
42    extern_methods!(
43        #[cfg(feature = "HKObjectType")]
44        #[unsafe(method(sampleType))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn sampleType(&self) -> Retained<HKSampleType>;
47
48        #[unsafe(method(startDate))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn startDate(&self) -> Retained<NSDate>;
51
52        #[unsafe(method(endDate))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn endDate(&self) -> Retained<NSDate>;
55
56        /// Indicates whether a sample has an undetermined duration.
57        ///
58        /// Computed based on the endDate of a sample.
59        #[unsafe(method(hasUndeterminedDuration))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn hasUndeterminedDuration(&self) -> bool;
62    );
63}
64
65/// Methods declared on superclass `HKObject`.
66#[cfg(feature = "HKObject")]
67impl HKSample {
68    extern_methods!(
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76#[cfg(feature = "HKObject")]
77impl HKSample {
78    extern_methods!(
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksamplesortidentifierstartdate?language=objc)
87    pub static HKSampleSortIdentifierStartDate: &'static NSString;
88}
89
90extern "C" {
91    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksamplesortidentifierenddate?language=objc)
92    pub static HKSampleSortIdentifierEndDate: &'static NSString;
93}
94
95extern "C" {
96    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkpredicatekeypathstartdate?language=objc)
97    pub static HKPredicateKeyPathStartDate: &'static NSString;
98}
99
100extern "C" {
101    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkpredicatekeypathenddate?language=objc)
102    pub static HKPredicateKeyPathEndDate: &'static NSString;
103}