objc2_core_bluetooth/generated/
CBService.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(CBAttribute, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "CBAttribute")]
17 pub struct CBService;
18);
19
20#[cfg(feature = "CBAttribute")]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for CBService {}
23);
24
25#[cfg(feature = "CBAttribute")]
26impl CBService {
27 extern_methods!(
28 #[cfg(all(feature = "CBPeer", feature = "CBPeripheral"))]
29 #[unsafe(method(peripheral))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn peripheral(&self) -> Option<Retained<CBPeripheral>>;
33
34 #[unsafe(method(isPrimary))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn isPrimary(&self) -> bool;
38
39 #[unsafe(method(includedServices))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn includedServices(&self) -> Option<Retained<NSArray<CBService>>>;
43
44 #[cfg(feature = "CBCharacteristic")]
45 #[unsafe(method(characteristics))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn characteristics(&self) -> Option<Retained<NSArray<CBCharacteristic>>>;
49 );
50}
51
52#[cfg(feature = "CBAttribute")]
54impl CBService {
55 extern_methods!(
56 #[unsafe(method(init))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59 );
60}
61
62#[cfg(feature = "CBAttribute")]
64impl CBService {
65 extern_methods!(
66 #[unsafe(method(new))]
67 #[unsafe(method_family = new)]
68 pub unsafe fn new() -> Retained<Self>;
69 );
70}
71
72extern_class!(
73 #[unsafe(super(CBService, CBAttribute, NSObject))]
88 #[derive(Debug, PartialEq, Eq, Hash)]
89 #[cfg(feature = "CBAttribute")]
90 pub struct CBMutableService;
91);
92
93#[cfg(feature = "CBAttribute")]
94extern_conformance!(
95 unsafe impl NSObjectProtocol for CBMutableService {}
96);
97
98#[cfg(feature = "CBAttribute")]
99impl CBMutableService {
100 extern_methods!(
101 #[unsafe(method(includedServices))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn includedServices(&self) -> Option<Retained<NSArray<CBService>>>;
104
105 #[unsafe(method(setIncludedServices:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setIncludedServices(&self, included_services: Option<&NSArray<CBService>>);
109
110 #[cfg(feature = "CBCharacteristic")]
111 #[unsafe(method(characteristics))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn characteristics(&self) -> Option<Retained<NSArray<CBCharacteristic>>>;
114
115 #[cfg(feature = "CBCharacteristic")]
116 #[unsafe(method(setCharacteristics:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setCharacteristics(
120 &self,
121 characteristics: Option<&NSArray<CBCharacteristic>>,
122 );
123
124 #[cfg(feature = "CBUUID")]
125 #[unsafe(method(initWithType:primary:))]
132 #[unsafe(method_family = init)]
133 pub unsafe fn initWithType_primary(
134 this: Allocated<Self>,
135 uuid: &CBUUID,
136 is_primary: bool,
137 ) -> Retained<Self>;
138 );
139}
140
141#[cfg(feature = "CBAttribute")]
143impl CBMutableService {
144 extern_methods!(
145 #[unsafe(method(init))]
146 #[unsafe(method_family = init)]
147 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148 );
149}
150
151#[cfg(feature = "CBAttribute")]
153impl CBMutableService {
154 extern_methods!(
155 #[unsafe(method(new))]
156 #[unsafe(method_family = new)]
157 pub unsafe fn new() -> Retained<Self>;
158 );
159}