objc2-health-kit 0.3.2

Bindings to the HealthKit framework
Documentation
//! 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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkstatisticsquery?language=objc)
    #[unsafe(super(HKQuery, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKQuery")]
    pub struct HKStatisticsQuery;
);

#[cfg(feature = "HKQuery")]
unsafe impl Send for HKStatisticsQuery {}

#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKStatisticsQuery {}

#[cfg(feature = "HKQuery")]
extern_conformance!(
    unsafe impl NSObjectProtocol for HKStatisticsQuery {}
);

#[cfg(feature = "HKQuery")]
impl HKStatisticsQuery {
    extern_methods!(
        #[cfg(all(feature = "HKObjectType", feature = "HKStatistics", feature = "block2"))]
        /// # Safety
        ///
        /// `handler` block must be sendable.
        #[unsafe(method(initWithQuantityType:quantitySamplePredicate:options:completionHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithQuantityType_quantitySamplePredicate_options_completionHandler(
            this: Allocated<Self>,
            quantity_type: &HKQuantityType,
            quantity_sample_predicate: Option<&NSPredicate>,
            options: HKStatisticsOptions,
            handler: &block2::DynBlock<
                dyn Fn(NonNull<HKStatisticsQuery>, *mut HKStatistics, *mut NSError),
            >,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKStatisticsQuery {
    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 HKStatisticsQuery {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}