objc2_foundation/generated/
NSMethodSignature.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmethodsignature?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSMethodSignature;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for NSMethodSignature {}
18);
19
20impl NSMethodSignature {
21    extern_methods!(
22        /// # Safety
23        ///
24        /// `types` must be a valid pointer.
25        #[unsafe(method(signatureWithObjCTypes:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn signatureWithObjCTypes(
28            types: NonNull<c_char>,
29        ) -> Option<Retained<NSMethodSignature>>;
30
31        #[unsafe(method(numberOfArguments))]
32        #[unsafe(method_family = none)]
33        pub fn numberOfArguments(&self) -> NSUInteger;
34
35        #[unsafe(method(getArgumentTypeAtIndex:))]
36        #[unsafe(method_family = none)]
37        pub fn getArgumentTypeAtIndex(&self, idx: NSUInteger) -> NonNull<c_char>;
38
39        #[unsafe(method(frameLength))]
40        #[unsafe(method_family = none)]
41        pub fn frameLength(&self) -> NSUInteger;
42
43        #[unsafe(method(isOneway))]
44        #[unsafe(method_family = none)]
45        pub fn isOneway(&self) -> bool;
46
47        #[unsafe(method(methodReturnType))]
48        #[unsafe(method_family = none)]
49        pub fn methodReturnType(&self) -> NonNull<c_char>;
50
51        #[unsafe(method(methodReturnLength))]
52        #[unsafe(method_family = none)]
53        pub fn methodReturnLength(&self) -> NSUInteger;
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58impl NSMethodSignature {
59    extern_methods!(
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub fn new() -> Retained<Self>;
67    );
68}
69
70impl DefaultRetained for NSMethodSignature {
71    #[inline]
72    fn default_retained() -> Retained<Self> {
73        Self::new()
74    }
75}