objc2_health_kit/generated/
HKVisionPrescription.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct HKVisionPrescriptionType(pub NSUInteger);
16impl HKVisionPrescriptionType {
17 #[doc(alias = "HKVisionPrescriptionTypeGlasses")]
18 pub const Glasses: Self = Self(1);
19 #[doc(alias = "HKVisionPrescriptionTypeContacts")]
20 pub const Contacts: Self = Self(2);
21}
22
23unsafe impl Encode for HKVisionPrescriptionType {
24 const ENCODING: Encoding = NSUInteger::ENCODING;
25}
26
27unsafe impl RefEncode for HKVisionPrescriptionType {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32 #[unsafe(super(HKSample, HKObject, NSObject))]
36 #[derive(Debug, PartialEq, Eq, Hash)]
37 #[cfg(all(feature = "HKObject", feature = "HKSample"))]
38 pub struct HKVisionPrescription;
39);
40
41#[cfg(all(feature = "HKObject", feature = "HKSample"))]
42unsafe impl Send for HKVisionPrescription {}
43
44#[cfg(all(feature = "HKObject", feature = "HKSample"))]
45unsafe impl Sync for HKVisionPrescription {}
46
47#[cfg(all(feature = "HKObject", feature = "HKSample"))]
48extern_conformance!(
49 unsafe impl NSCoding for HKVisionPrescription {}
50);
51
52#[cfg(all(feature = "HKObject", feature = "HKSample"))]
53extern_conformance!(
54 unsafe impl NSCopying for HKVisionPrescription {}
55);
56
57#[cfg(all(feature = "HKObject", feature = "HKSample"))]
58unsafe impl CopyingHelper for HKVisionPrescription {
59 type Result = Self;
60}
61
62#[cfg(all(feature = "HKObject", feature = "HKSample"))]
63extern_conformance!(
64 unsafe impl NSObjectProtocol for HKVisionPrescription {}
65);
66
67#[cfg(all(feature = "HKObject", feature = "HKSample"))]
68extern_conformance!(
69 unsafe impl NSSecureCoding for HKVisionPrescription {}
70);
71
72#[cfg(all(feature = "HKObject", feature = "HKSample"))]
73impl HKVisionPrescription {
74 extern_methods!(
75 #[unsafe(method(prescriptionType))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn prescriptionType(&self) -> HKVisionPrescriptionType;
85
86 #[unsafe(method(dateIssued))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn dateIssued(&self) -> Retained<NSDate>;
96
97 #[unsafe(method(expirationDate))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn expirationDate(&self) -> Option<Retained<NSDate>>;
107
108 #[cfg(feature = "HKDevice")]
109 #[unsafe(method(prescriptionWithType:dateIssued:expirationDate:device:metadata:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn prescriptionWithType_dateIssued_expirationDate_device_metadata(
125 r#type: HKVisionPrescriptionType,
126 date_issued: &NSDate,
127 expiration_date: Option<&NSDate>,
128 device: Option<&HKDevice>,
129 metadata: Option<&NSDictionary<NSString, AnyObject>>,
130 ) -> Retained<Self>;
131
132 #[unsafe(method(init))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136 #[unsafe(method(new))]
137 #[unsafe(method_family = new)]
138 pub unsafe fn new() -> Retained<Self>;
139 );
140}