1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! 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/localauthentication/laenvironmentmechanismbiometry?language=objc)
#[unsafe(super(LAEnvironmentMechanism, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "LAEnvironmentMechanism")]
pub struct LAEnvironmentMechanismBiometry;
);
#[cfg(feature = "LAEnvironmentMechanism")]
unsafe impl Send for LAEnvironmentMechanismBiometry {}
#[cfg(feature = "LAEnvironmentMechanism")]
unsafe impl Sync for LAEnvironmentMechanismBiometry {}
#[cfg(feature = "LAEnvironmentMechanism")]
extern_conformance!(
unsafe impl NSObjectProtocol for LAEnvironmentMechanismBiometry {}
);
#[cfg(feature = "LAEnvironmentMechanism")]
impl LAEnvironmentMechanismBiometry {
extern_methods!(
#[cfg(feature = "LABiometryType")]
/// Type of biometry supported by the device.
///
/// This property does not indicate whether biometry is available or not. It always reads the type of biometry
/// supported by device hardware. You should check
/// `isUsable`property to see if it is available for use.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(biometryType))]
#[unsafe(method_family = none)]
pub unsafe fn biometryType(&self) -> LABiometryType;
/// Whether the user has enrolled this biometry.
///
/// Even if biometry is enrolled, it does not necessarily mean that it can be used. You should check
/// `isUsable`property to see if it is available for use.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(isEnrolled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnrolled(&self) -> bool;
/// Whether biometry is locked out.
///
/// The system might lock the user out of biometry for various reasons. For example, with Face ID, the user is
/// locked out after 5 failed match attempts in row. To recover from bio lockout, users need to enter their passcode
/// (e.g. during device ulock).
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(isLockedOut))]
#[unsafe(method_family = none)]
pub unsafe fn isLockedOut(&self) -> bool;
/// The application specific state of the biometric enrollment as returned by
/// `LAContext.domainState.biometry.stateHash`
/// This value represents the state of the enrollment and changes whenever the biometric enrollment is changed.
/// It does not directly map to the enrolled templates, e.g. if a finger is added to Touch ID enrollement and then
/// removed, the final state would be different.
/// It also returns different values to different apps to prevent tracking of user identity.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(stateHash))]
#[unsafe(method_family = none)]
pub unsafe fn stateHash(&self) -> Retained<NSData>;
/// Whether the built in biometric sensor is inaccessible in the current configuration, preventing the use of biometry.
///
/// Currently, the only example of this is a Clamshell Mode on macOS. The user will be not able to use Touch ID
/// if the MacBook lid is closed while connected to external monitor and keyboard, unless the external keyboard
/// has Touch ID.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(builtInSensorInaccessible))]
#[unsafe(method_family = none)]
pub unsafe fn builtInSensorInaccessible(&self) -> bool;
);
}
/// Methods declared on superclass `LAEnvironmentMechanism`.
#[cfg(feature = "LAEnvironmentMechanism")]
impl LAEnvironmentMechanismBiometry {
extern_methods!(
/// Clients should only consume environment mechanisms..
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
/// The Clients should only consume environment mechanisms..
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}