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 ///
30 /// # Safety
31 ///
32 /// `handler` block must be sendable.
33 #[unsafe(method(loadDataWithCompletion:))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn loadDataWithCompletion(
36 &self,
37 handler: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
38 );
39
40 /// Clients cannot create
41 /// `LASecret`instances directly. They typically obtain them from a
42 /// `LAPersistedRight`instance.
43 #[unsafe(method(new))]
44 #[unsafe(method_family = new)]
45 pub unsafe fn new() -> Retained<Self>;
46
47 /// Clients cannot create
48 /// `LASecret`instances directly. They typically obtain them from a
49 /// `LAPersistedRight`instance.
50 #[unsafe(method(init))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53 );
54}