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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkquerydescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HKQueryDescriptor;
);

unsafe impl Send for HKQueryDescriptor {}

unsafe impl Sync for HKQueryDescriptor {}

extern_conformance!(
    unsafe impl NSCoding for HKQueryDescriptor {}
);

extern_conformance!(
    unsafe impl NSCopying for HKQueryDescriptor {}
);

unsafe impl CopyingHelper for HKQueryDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for HKQueryDescriptor {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for HKQueryDescriptor {}
);

impl HKQueryDescriptor {
    extern_methods!(
        #[cfg(feature = "HKObjectType")]
        /// The type of sample to retrieve in an HKQuery.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(sampleType))]
        #[unsafe(method_family = none)]
        pub unsafe fn sampleType(&self) -> Retained<HKSampleType>;

        /// The predicate which samples should match.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(predicate))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicate(&self) -> Option<Retained<NSPredicate>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "HKObjectType")]
        /// Returns a query descriptor that describes a data type and predicate to be used in an HKQuery.
        ///
        ///
        /// Parameter `sampleType`: The type of sample to retrieve.
        ///
        /// Parameter `predicate`: The predicate which samples should match.
        #[unsafe(method(initWithSampleType:predicate:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSampleType_predicate(
            this: Allocated<Self>,
            sample_type: &HKSampleType,
            predicate: Option<&NSPredicate>,
        ) -> Retained<Self>;
    );
}