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 #[unsafe(method(biometry))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn biometry(&self) -> Option<Retained<LAEnvironmentMechanismBiometry>>;
54
55 #[cfg(all(
56 feature = "LAEnvironmentMechanism",
57 feature = "LAEnvironmentMechanismUserPassword"
58 ))]
59 /// Information about local user password (on macOS) or passcode (on embedded platforms).
60 ///
61 /// `nil`if user password or passcode is not supported by this device.
62 #[unsafe(method(userPassword))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn userPassword(&self) -> Option<Retained<LAEnvironmentMechanismUserPassword>>;
65
66 #[cfg(all(
67 feature = "LAEnvironmentMechanism",
68 feature = "LAEnvironmentMechanismCompanion"
69 ))]
70 /// Companion authentication mechanisms.
71 ///
72 /// Companion mechanisms such as Apple Watch can appear and disappear as they get in and out of reach, but
73 /// this property enumerates paired companions, even if they are not reachable at the moment. Check
74 /// `isUsable`property to determine if a particular companion type is available for use.
75 /// Note that items in this array represent paired companion types, not individual devices. Therefore, even if the user
76 /// has paired multiple Apple Watch devices for companion authentication, the array will contain only one
77 /// `LAEnvironmentMechanimsCompanion`instance of type
78 /// `LACompanionTypeWatch.`
79 #[unsafe(method(companions))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn companions(&self) -> Retained<NSArray<LAEnvironmentMechanismCompanion>>;
82
83 #[cfg(feature = "LAEnvironmentMechanism")]
84 /// Information about all authentication mechanisms.
85 ///
86 /// This property aggregates
87 /// `biometry,``userPassword,``companions`and any future
88 /// authentication mechanisms.
89 #[unsafe(method(allMechanisms))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn allMechanisms(&self) -> Retained<NSArray<LAEnvironmentMechanism>>;
92 );
93}