objc2_local_authentication/generated/
LAPersistedRight.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::*;
5
6use crate::*;
7
8extern_class!(
9    /// A type of right that, when authorized, grants access to a key and secret
10    ///
11    /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lapersistedright?language=objc)
12    #[unsafe(super(LARight, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "LARight")]
15    pub struct LAPersistedRight;
16);
17
18#[cfg(feature = "LARight")]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for LAPersistedRight {}
21);
22
23#[cfg(feature = "LARight")]
24impl LAPersistedRight {
25    extern_methods!(
26        #[cfg(feature = "LAPrivateKey")]
27        /// Managed private key
28        #[unsafe(method(key))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn key(&self) -> Retained<LAPrivateKey>;
31
32        #[cfg(feature = "LASecret")]
33        /// Generic secret
34        ///
35        /// This is the generic secret that would have been stored along with the right
36        #[unsafe(method(secret))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn secret(&self) -> Retained<LASecret>;
39
40        /// Clients cannot create
41        /// `LAPersistedRight`instances directly. They can only obtain them from the
42        /// `LARightStore`.
43        #[unsafe(method(new))]
44        #[unsafe(method_family = new)]
45        pub unsafe fn new() -> Retained<Self>;
46
47        /// Clients cannot create
48        /// `LAPersistedRight`instances directly. They can only obtain them from the
49        /// `LARightStore`.
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53    );
54}
55
56/// Methods declared on superclass `LARight`.
57#[cfg(feature = "LARight")]
58impl LAPersistedRight {
59    extern_methods!(
60        #[cfg(feature = "LARequirement")]
61        /// Constructs a right that will be granted only when the given
62        /// `LAAuthenticationRequirement`is statisfied.
63        ///
64        /// Parameter `requirement`: Requirement that needs to be satisfied to authorize the right
65        ///
66        /// Returns: `LARight`instance
67        #[unsafe(method(initWithRequirement:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithRequirement(
70            this: Allocated<Self>,
71            requirement: &LAAuthenticationRequirement,
72        ) -> Retained<Self>;
73    );
74}