objc2_multipeer_connectivity/generated/
MCAdvertiserAssistant.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct MCAdvertiserAssistant;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for MCAdvertiserAssistant {}
19);
20
21impl MCAdvertiserAssistant {
22 extern_methods!(
23 #[cfg(feature = "MCSession")]
24 #[unsafe(method(initWithServiceType:discoveryInfo:session:))]
25 #[unsafe(method_family = init)]
26 pub unsafe fn initWithServiceType_discoveryInfo_session(
27 this: Allocated<Self>,
28 service_type: &NSString,
29 info: Option<&NSDictionary<NSString, NSString>>,
30 session: &MCSession,
31 ) -> Retained<Self>;
32
33 #[unsafe(method(start))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn start(&self);
36
37 #[unsafe(method(stop))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn stop(&self);
40
41 #[unsafe(method(delegate))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn delegate(
44 &self,
45 ) -> Option<Retained<ProtocolObject<dyn MCAdvertiserAssistantDelegate>>>;
46
47 #[unsafe(method(setDelegate:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn setDelegate(
53 &self,
54 delegate: Option<&ProtocolObject<dyn MCAdvertiserAssistantDelegate>>,
55 );
56
57 #[cfg(feature = "MCSession")]
58 #[unsafe(method(session))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn session(&self) -> Retained<MCSession>;
61
62 #[unsafe(method(discoveryInfo))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn discoveryInfo(&self) -> Option<Retained<NSDictionary<NSString, NSString>>>;
65
66 #[unsafe(method(serviceType))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn serviceType(&self) -> Retained<NSString>;
69 );
70}
71
72impl MCAdvertiserAssistant {
74 extern_methods!(
75 #[unsafe(method(init))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79 #[unsafe(method(new))]
80 #[unsafe(method_family = new)]
81 pub unsafe fn new() -> Retained<Self>;
82 );
83}
84
85extern_protocol!(
86 pub unsafe trait MCAdvertiserAssistantDelegate: NSObjectProtocol {
88 #[optional]
89 #[unsafe(method(advertiserAssistantWillPresentInvitation:))]
90 #[unsafe(method_family = none)]
91 unsafe fn advertiserAssistantWillPresentInvitation(
92 &self,
93 advertiser_assistant: &MCAdvertiserAssistant,
94 );
95
96 #[optional]
97 #[unsafe(method(advertiserAssistantDidDismissInvitation:))]
98 #[unsafe(method_family = none)]
99 unsafe fn advertiserAssistantDidDismissInvitation(
100 &self,
101 advertiser_assistant: &MCAdvertiserAssistant,
102 );
103 }
104);