1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A query to find HKCorrelations
///
/// Correlations are HKSamples that contain a set of correlated samples. HKCorrelationQuery
/// accepts a predicate to filter HKCorrelations and a dictionary of predicates to filter the
/// correlated samples.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkcorrelationquery?language=objc)
#[unsafe(super(HKQuery, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "HKQuery")]
pub struct HKCorrelationQuery;
);
#[cfg(feature = "HKQuery")]
unsafe impl Send for HKCorrelationQuery {}
#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKCorrelationQuery {}
#[cfg(feature = "HKQuery")]
extern_conformance!(
unsafe impl NSObjectProtocol for HKCorrelationQuery {}
);
#[cfg(feature = "HKQuery")]
impl HKCorrelationQuery {
extern_methods!(
#[cfg(feature = "HKObjectType")]
#[unsafe(method(correlationType))]
#[unsafe(method_family = none)]
pub unsafe fn correlationType(&self) -> Retained<HKCorrelationType>;
#[cfg(feature = "HKObjectType")]
/// A dictionary of predicates for the HKCorrelation's objects
///
/// samplePredicates maps HKSampleTypes to NSPredicates. The predicate value will apply
/// to objects of the key type.
#[unsafe(method(samplePredicates))]
#[unsafe(method_family = none)]
pub unsafe fn samplePredicates(
&self,
) -> Option<Retained<NSDictionary<HKSampleType, NSPredicate>>>;
#[cfg(all(
feature = "HKCorrelation",
feature = "HKObject",
feature = "HKObjectType",
feature = "HKSample",
feature = "block2"
))]
/// The designated initializer for HKCorrelationQuery.
///
///
/// Parameter `correlationType`: The type of correlation that is being queried for
///
///
/// Parameter `predicate`: The predicate for scoping which HKCorrelations are returned
///
///
/// Parameter `samplePredicates`: A dictionary mapping HKSampleTypes to NSPredicates. If no predicate for a particular type
/// is provided, it is assumed to be a nil predicate and objects of that type will not be
/// filtered.
///
/// # Safety
///
/// `completion` block must be sendable.
#[unsafe(method(initWithType:predicate:samplePredicates:completion:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithType_predicate_samplePredicates_completion(
this: Allocated<Self>,
correlation_type: &HKCorrelationType,
predicate: Option<&NSPredicate>,
sample_predicates: Option<&NSDictionary<HKSampleType, NSPredicate>>,
completion: &block2::DynBlock<
dyn Fn(NonNull<HKCorrelationQuery>, *mut NSArray<HKCorrelation>, *mut NSError),
>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKCorrelationQuery {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "HKQuery")]
impl HKCorrelationQuery {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}