objc2_health_kit/generated/
HKHeartbeatSeriesQuery.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/hkheartbeatseriesquery?language=objc)
12    #[unsafe(super(HKQuery, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "HKQuery")]
15    pub struct HKHeartbeatSeriesQuery;
16);
17
18#[cfg(feature = "HKQuery")]
19unsafe impl Send for HKHeartbeatSeriesQuery {}
20
21#[cfg(feature = "HKQuery")]
22unsafe impl Sync for HKHeartbeatSeriesQuery {}
23
24#[cfg(feature = "HKQuery")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for HKHeartbeatSeriesQuery {}
27);
28
29#[cfg(feature = "HKQuery")]
30impl HKHeartbeatSeriesQuery {
31    extern_methods!(
32        #[cfg(all(
33            feature = "HKHeartbeatSeriesSample",
34            feature = "HKObject",
35            feature = "HKSample",
36            feature = "HKSeriesSample",
37            feature = "block2"
38        ))]
39        /// Returns a query that will retrieve heartbeat timestamps for the specified HKHeartbeatSeriesSample.
40        ///
41        ///
42        /// Parameter `heartbeatSeries`: The HKHeartbeatSeriesSample for which the heartbeat data will be returned.
43        ///
44        /// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly for each
45        /// heartbeat in the series. timeSinceSeriesStart is the time elapsed in seconds after the
46        /// series startDate that represents when the heartbeat occured. precededByGap indicates if
47        /// there was a gap in data collection before the current heartbeat, meaning that one or more
48        /// heartbeats may have occured since the previous heartbeat in the series. Once done is YES,
49        /// or stopQuery called, the query is complete and no more calls to the handler will be made.
50        ///
51        /// # Safety
52        ///
53        /// `data_handler` block must be sendable.
54        #[unsafe(method(initWithHeartbeatSeries:dataHandler:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithHeartbeatSeries_dataHandler(
57            this: Allocated<Self>,
58            heartbeat_series: &HKHeartbeatSeriesSample,
59            data_handler: &block2::DynBlock<
60                dyn Fn(NonNull<HKHeartbeatSeriesQuery>, NSTimeInterval, Bool, Bool, *mut NSError),
61            >,
62        ) -> Retained<Self>;
63    );
64}
65
66/// Methods declared on superclass `HKQuery`.
67#[cfg(feature = "HKQuery")]
68impl HKHeartbeatSeriesQuery {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73    );
74}
75
76/// Methods declared on superclass `NSObject`.
77#[cfg(feature = "HKQuery")]
78impl HKHeartbeatSeriesQuery {
79    extern_methods!(
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new() -> Retained<Self>;
83    );
84}