objc2_local_authentication/generated/LAError.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 "C" {
10 /// LocalAuthentication error domain.
11 ///
12 /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/laerrordomain?language=objc)
13 pub static LAErrorDomain: &'static NSString;
14}
15
16/// [Apple's documentation](https://developer.apple.com/documentation/localauthentication/laerror?language=objc)
17// NS_ENUM
18#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct LAError(pub NSInteger);
21impl LAError {
22 /// Authentication was not successful because user failed to provide valid credentials.
23 #[doc(alias = "LAErrorAuthenticationFailed")]
24 pub const AuthenticationFailed: Self = Self(-1);
25 /// Authentication was canceled by user (e.g. tapped Cancel button).
26 #[doc(alias = "LAErrorUserCancel")]
27 pub const UserCancel: Self = Self(-2);
28 /// Authentication was canceled because the user tapped the fallback button (Enter Password).
29 #[doc(alias = "LAErrorUserFallback")]
30 pub const UserFallback: Self = Self(-3);
31 /// Authentication was canceled by system (e.g. another application went to foreground).
32 #[doc(alias = "LAErrorSystemCancel")]
33 pub const SystemCancel: Self = Self(-4);
34 /// Authentication could not start because passcode is not set on the device.
35 #[doc(alias = "LAErrorPasscodeNotSet")]
36 pub const PasscodeNotSet: Self = Self(-5);
37 /// Authentication could not start because Touch ID is not available on the device.
38 #[doc(alias = "LAErrorTouchIDNotAvailable")]
39 #[deprecated = "use LAErrorBiometryNotAvailable"]
40 pub const TouchIDNotAvailable: Self = Self(-6);
41 /// Authentication could not start because Touch ID has no enrolled fingers.
42 #[doc(alias = "LAErrorTouchIDNotEnrolled")]
43 #[deprecated = "use LAErrorBiometryNotEnrolled"]
44 pub const TouchIDNotEnrolled: Self = Self(-7);
45 /// Authentication was not successful because there were too many failed Touch ID attempts and
46 /// Touch ID is now locked. Passcode is required to unlock Touch ID, e.g. evaluating
47 /// LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite.
48 #[doc(alias = "LAErrorTouchIDLockout")]
49 #[deprecated = "use LAErrorBiometryLockout"]
50 pub const TouchIDLockout: Self = Self(-8);
51 /// Authentication was canceled by application (e.g. invalidate was called while
52 /// authentication was in progress).
53 #[doc(alias = "LAErrorAppCancel")]
54 pub const AppCancel: Self = Self(-9);
55 /// LAContext passed to this call has been previously invalidated.
56 #[doc(alias = "LAErrorInvalidContext")]
57 pub const InvalidContext: Self = Self(-10);
58 /// Authentication could not start because biometry is not available on the device.
59 #[doc(alias = "LAErrorBiometryNotAvailable")]
60 pub const BiometryNotAvailable: Self = Self(-6);
61 /// Authentication could not start because biometry has no enrolled identities.
62 #[doc(alias = "LAErrorBiometryNotEnrolled")]
63 pub const BiometryNotEnrolled: Self = Self(-7);
64 /// Authentication was not successful because there were too many failed biometry attempts and
65 /// biometry is now locked. Passcode is required to unlock biometry, e.g. evaluating
66 /// LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite.
67 #[doc(alias = "LAErrorBiometryLockout")]
68 pub const BiometryLockout: Self = Self(-8);
69 /// Authentication failed because it would require showing UI which has been forbidden
70 /// by using interactionNotAllowed property.
71 #[doc(alias = "LAErrorNotInteractive")]
72 pub const NotInteractive: Self = Self(-1004);
73 /// Authentication could not start because there was no paired watch device nearby.
74 #[doc(alias = "LAErrorWatchNotAvailable")]
75 #[deprecated]
76 pub const WatchNotAvailable: Self = Self(-11);
77 /// Authentication could not start because there was no paired companion device nearby.
78 #[doc(alias = "LAErrorCompanionNotAvailable")]
79 pub const CompanionNotAvailable: Self = Self(-11);
80 /// Authentication could not start because this device supports biometry only via removable accessories and no accessory has been paired.
81 #[doc(alias = "LAErrorBiometryNotPaired")]
82 pub const BiometryNotPaired: Self = Self(-12);
83 /// Authentication could not start because this device supports biometry only via removable accessories and the paired accessory is not connected.
84 #[doc(alias = "LAErrorBiometryDisconnected")]
85 pub const BiometryDisconnected: Self = Self(-13);
86 /// Authentication could not start because dimensions of embedded UI are invalid.
87 #[doc(alias = "LAErrorInvalidDimensions")]
88 pub const InvalidDimensions: Self = Self(-14);
89}
90
91unsafe impl Encode for LAError {
92 const ENCODING: Encoding = NSInteger::ENCODING;
93}
94
95unsafe impl RefEncode for LAError {
96 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
97}