objc2_health_kit/generated/
HKSourceQuery.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcequery?language=objc)
12    #[unsafe(super(HKQuery, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "HKQuery")]
15    pub struct HKSourceQuery;
16);
17
18#[cfg(feature = "HKQuery")]
19unsafe impl Send for HKSourceQuery {}
20
21#[cfg(feature = "HKQuery")]
22unsafe impl Sync for HKSourceQuery {}
23
24#[cfg(feature = "HKQuery")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for HKSourceQuery {}
27);
28
29#[cfg(feature = "HKQuery")]
30impl HKSourceQuery {
31    extern_methods!(
32        #[cfg(all(feature = "HKObjectType", feature = "HKSource", feature = "block2"))]
33        /// Returns a query that will retrieve HKSources that have saved samples of the given type matching the
34        /// given predicate.
35        ///
36        ///
37        /// Parameter `sampleType`: The type of sample.
38        ///
39        /// Parameter `objectPredicate`: The predicate which samples must match.
40        ///
41        /// Parameter `completionHandler`: The block to be called when the query has finished executing.
42        ///
43        /// # Safety
44        ///
45        /// `completion_handler` block must be sendable.
46        #[unsafe(method(initWithSampleType:samplePredicate:completionHandler:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithSampleType_samplePredicate_completionHandler(
49            this: Allocated<Self>,
50            sample_type: &HKSampleType,
51            object_predicate: Option<&NSPredicate>,
52            completion_handler: &block2::DynBlock<
53                dyn Fn(NonNull<HKSourceQuery>, *mut NSSet<HKSource>, *mut NSError),
54            >,
55        ) -> Retained<Self>;
56    );
57}
58
59/// Methods declared on superclass `HKQuery`.
60#[cfg(feature = "HKQuery")]
61impl HKSourceQuery {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70#[cfg(feature = "HKQuery")]
71impl HKSourceQuery {
72    extern_methods!(
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new() -> Retained<Self>;
76    );
77}