objc2_core_bluetooth/generated/
CBL2CAPChannel.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbl2cappsm?language=objc)
10pub type CBL2CAPPSM = u16;
11
12extern_class!(
13    /// A CBL2CAPChannel represents a live L2CAP connection to a remote device
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbl2capchannel?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct CBL2CAPChannel;
19);
20
21unsafe impl NSObjectProtocol for CBL2CAPChannel {}
22
23impl CBL2CAPChannel {
24    extern_methods!(
25        #[cfg(feature = "CBPeer")]
26        /// The peer connected to the channel
27        #[unsafe(method(peer))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn peer(&self) -> Option<Retained<CBPeer>>;
30
31        /// An NSStream used for reading data from the remote peer
32        #[unsafe(method(inputStream))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn inputStream(&self) -> Option<Retained<NSInputStream>>;
35
36        /// An NSStream used for writing data to the peer
37        #[unsafe(method(outputStream))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn outputStream(&self) -> Option<Retained<NSOutputStream>>;
40
41        /// The PSM (Protocol/Service Multiplexer) of the channel
42        #[unsafe(method(PSM))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn PSM(&self) -> CBL2CAPPSM;
45    );
46}
47
48/// Methods declared on superclass `NSObject`.
49impl CBL2CAPChannel {
50    extern_methods!(
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[unsafe(method(new))]
56        #[unsafe(method_family = new)]
57        pub unsafe fn new() -> Retained<Self>;
58    );
59}