objc2_foundation/generated/
NSProtocolChecker.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::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsprotocolchecker?language=objc)
10    #[unsafe(super(NSProxy))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    #[cfg(feature = "NSProxy")]
13    pub struct NSProtocolChecker;
14);
15
16#[cfg(feature = "NSProxy")]
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSProtocolChecker {}
19);
20
21#[cfg(feature = "NSProxy")]
22impl NSProtocolChecker {
23    extern_methods!(
24        #[unsafe(method(protocol))]
25        #[unsafe(method_family = none)]
26        pub fn protocol(&self) -> Retained<AnyProtocol>;
27
28        #[unsafe(method(target))]
29        #[unsafe(method_family = none)]
30        pub fn target(&self) -> Option<Retained<NSObject>>;
31    );
32}
33
34/// NSProtocolCheckerCreation.
35#[cfg(feature = "NSProxy")]
36impl NSProtocolChecker {
37    extern_methods!(
38        /// # Safety
39        ///
40        /// - `an_object` should be of the correct type.
41        /// - `a_protocol` possibly has further requirements.
42        #[unsafe(method(protocolCheckerWithTarget:protocol:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn protocolCheckerWithTarget_protocol(
45            an_object: &NSObject,
46            a_protocol: &AnyProtocol,
47        ) -> Retained<Self>;
48
49        /// # Safety
50        ///
51        /// - `an_object` should be of the correct type.
52        /// - `a_protocol` possibly has further requirements.
53        #[unsafe(method(initWithTarget:protocol:))]
54        #[unsafe(method_family = init)]
55        pub unsafe fn initWithTarget_protocol(
56            this: Allocated<Self>,
57            an_object: &NSObject,
58            a_protocol: &AnyProtocol,
59        ) -> Retained<Self>;
60    );
61}