objc2_local_authentication/generated/LAEnvironmentState.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/localauthentication/laenvironmentstate?language=objc)
11 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct LAEnvironmentState;
14);
15
16unsafe impl Send for LAEnvironmentState {}
17
18unsafe impl Sync for LAEnvironmentState {}
19
20extern_conformance!(
21 unsafe impl NSCopying for LAEnvironmentState {}
22);
23
24unsafe impl CopyingHelper for LAEnvironmentState {
25 type Result = Self;
26}
27
28extern_conformance!(
29 unsafe impl NSObjectProtocol for LAEnvironmentState {}
30);
31
32impl LAEnvironmentState {
33 extern_methods!(
34 /// Clients shall not create environment state.
35 #[unsafe(method(init))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39 /// Clients shall not create environment state.
40 #[unsafe(method(new))]
41 #[unsafe(method_family = new)]
42 pub unsafe fn new() -> Retained<Self>;
43
44 #[cfg(all(
45 feature = "LAEnvironmentMechanism",
46 feature = "LAEnvironmentMechanismBiometry"
47 ))]
48 /// Information about biometric authentication (Touch ID, Face ID or Optic ID).
49 ///
50 /// `nil`if biometry is not supported by this device.
51 ///
52 /// This property is not atomic.
53 ///
54 /// # Safety
55 ///
56 /// This might not be thread-safe.
57 #[unsafe(method(biometry))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn biometry(&self) -> Option<Retained<LAEnvironmentMechanismBiometry>>;
60
61 #[cfg(all(
62 feature = "LAEnvironmentMechanism",
63 feature = "LAEnvironmentMechanismUserPassword"
64 ))]
65 /// Information about local user password (on macOS) or passcode (on embedded platforms).
66 ///
67 /// `nil`if user password or passcode is not supported by this device.
68 ///
69 /// This property is not atomic.
70 ///
71 /// # Safety
72 ///
73 /// This might not be thread-safe.
74 #[unsafe(method(userPassword))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn userPassword(&self) -> Option<Retained<LAEnvironmentMechanismUserPassword>>;
77
78 #[cfg(all(
79 feature = "LAEnvironmentMechanism",
80 feature = "LAEnvironmentMechanismCompanion"
81 ))]
82 /// Companion authentication mechanisms.
83 ///
84 /// Companion mechanisms such as Apple Watch can appear and disappear as they get in and out of reach, but
85 /// this property enumerates paired companions, even if they are not reachable at the moment. Check
86 /// `isUsable`property to determine if a particular companion type is available for use.
87 /// Note that items in this array represent paired companion types, not individual devices. Therefore, even if the user
88 /// has paired multiple Apple Watch devices for companion authentication, the array will contain only one
89 /// `LAEnvironmentMechanimsCompanion`instance of type
90 /// `LACompanionTypeWatch.`
91 ///
92 /// This property is not atomic.
93 ///
94 /// # Safety
95 ///
96 /// This might not be thread-safe.
97 #[unsafe(method(companions))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn companions(&self) -> Retained<NSArray<LAEnvironmentMechanismCompanion>>;
100
101 #[cfg(feature = "LAEnvironmentMechanism")]
102 /// Information about all authentication mechanisms.
103 ///
104 /// This property aggregates
105 /// `biometry,``userPassword,``companions`and any future
106 /// authentication mechanisms.
107 ///
108 /// This property is not atomic.
109 ///
110 /// # Safety
111 ///
112 /// This might not be thread-safe.
113 #[unsafe(method(allMechanisms))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn allMechanisms(&self) -> Retained<NSArray<LAEnvironmentMechanism>>;
116 );
117}