objc2_health_kit/generated/
HKQueryDescriptor.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    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkquerydescriptor?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct HKQueryDescriptor;
14);
15
16unsafe impl Send for HKQueryDescriptor {}
17
18unsafe impl Sync for HKQueryDescriptor {}
19
20extern_conformance!(
21    unsafe impl NSCoding for HKQueryDescriptor {}
22);
23
24extern_conformance!(
25    unsafe impl NSCopying for HKQueryDescriptor {}
26);
27
28unsafe impl CopyingHelper for HKQueryDescriptor {
29    type Result = Self;
30}
31
32extern_conformance!(
33    unsafe impl NSObjectProtocol for HKQueryDescriptor {}
34);
35
36extern_conformance!(
37    unsafe impl NSSecureCoding for HKQueryDescriptor {}
38);
39
40impl HKQueryDescriptor {
41    extern_methods!(
42        #[cfg(feature = "HKObjectType")]
43        /// The type of sample to retrieve in an HKQuery.
44        ///
45        /// This property is not atomic.
46        ///
47        /// # Safety
48        ///
49        /// This might not be thread-safe.
50        #[unsafe(method(sampleType))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn sampleType(&self) -> Retained<HKSampleType>;
53
54        /// The predicate which samples should match.
55        ///
56        /// This property is not atomic.
57        ///
58        /// # Safety
59        ///
60        /// This might not be thread-safe.
61        #[unsafe(method(predicate))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn predicate(&self) -> Option<Retained<NSPredicate>>;
64
65        #[unsafe(method(init))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
68
69        #[unsafe(method(new))]
70        #[unsafe(method_family = new)]
71        pub unsafe fn new() -> Retained<Self>;
72
73        #[cfg(feature = "HKObjectType")]
74        /// Returns a query descriptor that describes a data type and predicate to be used in an HKQuery.
75        ///
76        ///
77        /// Parameter `sampleType`: The type of sample to retrieve.
78        ///
79        /// Parameter `predicate`: The predicate which samples should match.
80        #[unsafe(method(initWithSampleType:predicate:))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn initWithSampleType_predicate(
83            this: Allocated<Self>,
84            sample_type: &HKSampleType,
85            predicate: Option<&NSPredicate>,
86        ) -> Retained<Self>;
87    );
88}