objc2_local_authentication/generated/LASecret.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// Generic secret
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/localauthentication/lasecret?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct LASecret;
17);
18
19extern_conformance!(
20 unsafe impl NSObjectProtocol for LASecret {}
21);
22
23impl LASecret {
24 extern_methods!(
25 #[cfg(feature = "block2")]
26 /// Fetch stored data if any
27 ///
28 /// Parameter `handler`: Completion handler invoked with a generic secret stored along with the right or an error if no secret is found or the fetch operation fails.
29 #[unsafe(method(loadDataWithCompletion:))]
30 #[unsafe(method_family = none)]
31 pub unsafe fn loadDataWithCompletion(
32 &self,
33 handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
34 );
35
36 /// Clients cannot create
37 /// `LASecret`instances directly. They typically obtain them from a
38 /// `LAPersistedRight`instance.
39 #[unsafe(method(new))]
40 #[unsafe(method_family = new)]
41 pub unsafe fn new() -> Retained<Self>;
42
43 /// Clients cannot create
44 /// `LASecret`instances directly. They typically obtain them from a
45 /// `LAPersistedRight`instance.
46 #[unsafe(method(init))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49 );
50}