objc2_crypto_token_kit/generated/TKSmartCardSlotNFCSession.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 /// NFC session that's related to NFC smart card slot which was created.
12 ///
13 /// Lifetime of this session object is tied to the NFC smart card slot lifetime
14 /// and once the NFC slot disappears (eg. after a user cancellation, calling end session, or an NFC timeout)
15 /// the functions will start to fail and return `TKErrorCodeObjectNotFound` error.
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/cryptotokenkit/tksmartcardslotnfcsession?language=objc)
18 #[unsafe(super(NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct TKSmartCardSlotNFCSession;
21);
22
23unsafe impl Send for TKSmartCardSlotNFCSession {}
24
25unsafe impl Sync for TKSmartCardSlotNFCSession {}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for TKSmartCardSlotNFCSession {}
29);
30
31impl TKSmartCardSlotNFCSession {
32 extern_methods!(
33 /// Smart card slot name of the NFC slot that was created together with this session.
34 ///
35 /// This property is not atomic.
36 ///
37 /// # Safety
38 ///
39 /// This might not be thread-safe.
40 #[unsafe(method(slotName))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn slotName(&self) -> Option<Retained<NSString>>;
43
44 /// Clients should only receive the session
45 #[unsafe(method(init))]
46 #[unsafe(method_family = init)]
47 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49 /// Updates the message of the system-presented NFC UI.
50 ///
51 /// Parameter `message`: Message that should be displayed
52 ///
53 /// Parameter `error`: Specific error describing why the operation failed
54 ///
55 /// Returns: Returns `YES` if the alert message was updated, `NO` if an error occured.
56 #[unsafe(method(updateWithMessage:error:_))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn updateWithMessage_error(
59 &self,
60 message: &NSString,
61 ) -> Result<(), Retained<NSError>>;
62
63 /// Ends the NFC slot session and dismisses the system-presented NFC UI (if present).
64 #[unsafe(method(endSession))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn endSession(&self);
67 );
68}
69
70/// Methods declared on superclass `NSObject`.
71impl TKSmartCardSlotNFCSession {
72 extern_methods!(
73 #[unsafe(method(new))]
74 #[unsafe(method_family = new)]
75 pub unsafe fn new() -> Retained<Self>;
76 );
77}