objc2_foundation/generated/
NSClassDescription.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSClassDescription;
14);
15
16extern_conformance!(
17 unsafe impl NSObjectProtocol for NSClassDescription {}
18);
19
20impl NSClassDescription {
21 extern_methods!(
22 #[unsafe(method(registerClassDescription:forClass:))]
26 #[unsafe(method_family = none)]
27 pub unsafe fn registerClassDescription_forClass(
28 description: &NSClassDescription,
29 a_class: &AnyClass,
30 );
31
32 #[unsafe(method(invalidateClassDescriptionCache))]
33 #[unsafe(method_family = none)]
34 pub fn invalidateClassDescriptionCache();
35
36 #[unsafe(method(classDescriptionForClass:))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn classDescriptionForClass(
42 a_class: &AnyClass,
43 ) -> Option<Retained<NSClassDescription>>;
44
45 #[cfg(all(feature = "NSArray", feature = "NSString"))]
46 #[unsafe(method(attributeKeys))]
47 #[unsafe(method_family = none)]
48 pub fn attributeKeys(&self) -> Retained<NSArray<NSString>>;
49
50 #[cfg(all(feature = "NSArray", feature = "NSString"))]
51 #[unsafe(method(toOneRelationshipKeys))]
52 #[unsafe(method_family = none)]
53 pub fn toOneRelationshipKeys(&self) -> Retained<NSArray<NSString>>;
54
55 #[cfg(all(feature = "NSArray", feature = "NSString"))]
56 #[unsafe(method(toManyRelationshipKeys))]
57 #[unsafe(method_family = none)]
58 pub fn toManyRelationshipKeys(&self) -> Retained<NSArray<NSString>>;
59
60 #[cfg(feature = "NSString")]
61 #[unsafe(method(inverseForRelationshipKey:))]
62 #[unsafe(method_family = none)]
63 pub fn inverseForRelationshipKey(
64 &self,
65 relationship_key: &NSString,
66 ) -> Option<Retained<NSString>>;
67 );
68}
69
70impl NSClassDescription {
72 extern_methods!(
73 #[unsafe(method(init))]
74 #[unsafe(method_family = init)]
75 pub fn init(this: Allocated<Self>) -> Retained<Self>;
76
77 #[unsafe(method(new))]
78 #[unsafe(method_family = new)]
79 pub fn new() -> Retained<Self>;
80 );
81}
82
83impl DefaultRetained for NSClassDescription {
84 #[inline]
85 fn default_retained() -> Retained<Self> {
86 Self::new()
87 }
88}
89
90mod private_NSObjectNSClassDescriptionPrimitives {
91 pub trait Sealed {}
92}
93
94#[doc(alias = "NSClassDescriptionPrimitives")]
96pub unsafe trait NSObjectNSClassDescriptionPrimitives:
97 ClassType + Sized + private_NSObjectNSClassDescriptionPrimitives::Sealed
98{
99 extern_methods!(
100 #[unsafe(method(classDescription))]
101 #[unsafe(method_family = none)]
102 fn classDescription(&self) -> Retained<NSClassDescription>;
103
104 #[cfg(all(feature = "NSArray", feature = "NSString"))]
105 #[unsafe(method(attributeKeys))]
106 #[unsafe(method_family = none)]
107 fn attributeKeys(&self) -> Retained<NSArray<NSString>>;
108
109 #[cfg(all(feature = "NSArray", feature = "NSString"))]
110 #[unsafe(method(toOneRelationshipKeys))]
111 #[unsafe(method_family = none)]
112 fn toOneRelationshipKeys(&self) -> Retained<NSArray<NSString>>;
113
114 #[cfg(all(feature = "NSArray", feature = "NSString"))]
115 #[unsafe(method(toManyRelationshipKeys))]
116 #[unsafe(method_family = none)]
117 fn toManyRelationshipKeys(&self) -> Retained<NSArray<NSString>>;
118
119 #[cfg(feature = "NSString")]
120 #[unsafe(method(inverseForRelationshipKey:))]
121 #[unsafe(method_family = none)]
122 fn inverseForRelationshipKey(
123 &self,
124 relationship_key: &NSString,
125 ) -> Option<Retained<NSString>>;
126 );
127}
128
129impl private_NSObjectNSClassDescriptionPrimitives::Sealed for NSObject {}
130unsafe impl NSObjectNSClassDescriptionPrimitives for NSObject {}
131
132extern "C" {
133 #[cfg(all(feature = "NSNotification", feature = "NSString"))]
135 pub static NSClassDescriptionNeededForClassNotification: &'static NSNotificationName;
136}