objc2_core_data/generated/
NSEntityDescription.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nsentitydescription?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSEntityDescription;
15);
16
17extern_conformance!(
18    unsafe impl NSCoding for NSEntityDescription {}
19);
20
21extern_conformance!(
22    unsafe impl NSCopying for NSEntityDescription {}
23);
24
25unsafe impl CopyingHelper for NSEntityDescription {
26    type Result = Self;
27}
28
29extern_conformance!(
30    unsafe impl NSFastEnumeration for NSEntityDescription {}
31);
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for NSEntityDescription {}
35);
36
37impl NSEntityDescription {
38    extern_methods!(
39        #[cfg(feature = "NSManagedObjectContext")]
40        #[unsafe(method(entityForName:inManagedObjectContext:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn entityForName_inManagedObjectContext(
43            entity_name: &NSString,
44            context: &NSManagedObjectContext,
45        ) -> Option<Retained<NSEntityDescription>>;
46
47        #[cfg(all(feature = "NSManagedObject", feature = "NSManagedObjectContext"))]
48        #[unsafe(method(insertNewObjectForEntityForName:inManagedObjectContext:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn insertNewObjectForEntityForName_inManagedObjectContext(
51            entity_name: &NSString,
52            context: &NSManagedObjectContext,
53        ) -> Retained<NSManagedObject>;
54
55        #[cfg(feature = "NSManagedObjectModel")]
56        /// # Safety
57        ///
58        /// This is not retained internally, you must ensure the object is still alive.
59        #[unsafe(method(managedObjectModel))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn managedObjectModel(&self) -> Retained<NSManagedObjectModel>;
62
63        #[unsafe(method(managedObjectClassName))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn managedObjectClassName(&self) -> Retained<NSString>;
66
67        /// Setter for [`managedObjectClassName`][Self::managedObjectClassName].
68        ///
69        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
70        #[unsafe(method(setManagedObjectClassName:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setManagedObjectClassName(
73            &self,
74            managed_object_class_name: Option<&NSString>,
75        );
76
77        #[unsafe(method(name))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
80
81        /// Setter for [`name`][Self::name].
82        ///
83        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
84        #[unsafe(method(setName:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setName(&self, name: Option<&NSString>);
87
88        #[unsafe(method(isAbstract))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn isAbstract(&self) -> bool;
91
92        /// Setter for [`isAbstract`][Self::isAbstract].
93        #[unsafe(method(setAbstract:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setAbstract(&self, r#abstract: bool);
96
97        #[unsafe(method(subentitiesByName))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn subentitiesByName(
100            &self,
101        ) -> Retained<NSDictionary<NSString, NSEntityDescription>>;
102
103        #[unsafe(method(subentities))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn subentities(&self) -> Retained<NSArray<NSEntityDescription>>;
106
107        /// Setter for [`subentities`][Self::subentities].
108        #[unsafe(method(setSubentities:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setSubentities(&self, subentities: &NSArray<NSEntityDescription>);
111
112        /// # Safety
113        ///
114        /// This is not retained internally, you must ensure the object is still alive.
115        #[unsafe(method(superentity))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn superentity(&self) -> Option<Retained<NSEntityDescription>>;
118
119        #[cfg(feature = "NSPropertyDescription")]
120        #[unsafe(method(propertiesByName))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn propertiesByName(
123            &self,
124        ) -> Retained<NSDictionary<NSString, NSPropertyDescription>>;
125
126        #[cfg(feature = "NSPropertyDescription")]
127        #[unsafe(method(properties))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn properties(&self) -> Retained<NSArray<NSPropertyDescription>>;
130
131        #[cfg(feature = "NSPropertyDescription")]
132        /// Setter for [`properties`][Self::properties].
133        #[unsafe(method(setProperties:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setProperties(&self, properties: &NSArray<NSPropertyDescription>);
136
137        #[unsafe(method(userInfo))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;
140
141        /// Setter for [`userInfo`][Self::userInfo].
142        ///
143        /// # Safety
144        ///
145        /// `user_info` generic should be of the correct type.
146        #[unsafe(method(setUserInfo:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
149
150        #[cfg(all(feature = "NSAttributeDescription", feature = "NSPropertyDescription"))]
151        #[unsafe(method(attributesByName))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn attributesByName(
154            &self,
155        ) -> Retained<NSDictionary<NSString, NSAttributeDescription>>;
156
157        #[cfg(all(
158            feature = "NSPropertyDescription",
159            feature = "NSRelationshipDescription"
160        ))]
161        #[unsafe(method(relationshipsByName))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn relationshipsByName(
164            &self,
165        ) -> Retained<NSDictionary<NSString, NSRelationshipDescription>>;
166
167        #[cfg(all(
168            feature = "NSPropertyDescription",
169            feature = "NSRelationshipDescription"
170        ))]
171        #[unsafe(method(relationshipsWithDestinationEntity:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn relationshipsWithDestinationEntity(
174            &self,
175            entity: &NSEntityDescription,
176        ) -> Retained<NSArray<NSRelationshipDescription>>;
177
178        #[unsafe(method(isKindOfEntity:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn isKindOfEntity(&self, entity: &NSEntityDescription) -> bool;
181
182        #[unsafe(method(versionHash))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn versionHash(&self) -> Retained<NSData>;
185
186        #[unsafe(method(versionHashModifier))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn versionHashModifier(&self) -> Option<Retained<NSString>>;
189
190        /// Setter for [`versionHashModifier`][Self::versionHashModifier].
191        ///
192        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
193        #[unsafe(method(setVersionHashModifier:))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn setVersionHashModifier(&self, version_hash_modifier: Option<&NSString>);
196
197        #[unsafe(method(renamingIdentifier))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn renamingIdentifier(&self) -> Option<Retained<NSString>>;
200
201        /// Setter for [`renamingIdentifier`][Self::renamingIdentifier].
202        ///
203        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
204        #[unsafe(method(setRenamingIdentifier:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn setRenamingIdentifier(&self, renaming_identifier: Option<&NSString>);
207
208        #[cfg(feature = "NSFetchIndexDescription")]
209        #[unsafe(method(indexes))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn indexes(&self) -> Retained<NSArray<NSFetchIndexDescription>>;
212
213        #[cfg(feature = "NSFetchIndexDescription")]
214        /// Setter for [`indexes`][Self::indexes].
215        ///
216        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
217        #[unsafe(method(setIndexes:))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn setIndexes(&self, indexes: &NSArray<NSFetchIndexDescription>);
220
221        #[unsafe(method(uniquenessConstraints))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn uniquenessConstraints(&self) -> Retained<NSArray<NSArray<AnyObject>>>;
224
225        /// Setter for [`uniquenessConstraints`][Self::uniquenessConstraints].
226        ///
227        /// # Safety
228        ///
229        /// `uniqueness_constraints` generic generic should be of the correct type.
230        #[unsafe(method(setUniquenessConstraints:))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn setUniquenessConstraints(
233            &self,
234            uniqueness_constraints: &NSArray<NSArray<AnyObject>>,
235        );
236
237        #[deprecated = "Use NSEntityDescription.indexes instead"]
238        #[unsafe(method(compoundIndexes))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn compoundIndexes(&self) -> Retained<NSArray<NSArray<AnyObject>>>;
241
242        /// Setter for [`compoundIndexes`][Self::compoundIndexes].
243        ///
244        /// # Safety
245        ///
246        /// `compound_indexes` generic generic should be of the correct type.
247        #[deprecated = "Use NSEntityDescription.indexes instead"]
248        #[unsafe(method(setCompoundIndexes:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setCompoundIndexes(&self, compound_indexes: &NSArray<NSArray<AnyObject>>);
251
252        #[unsafe(method(coreSpotlightDisplayNameExpression))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn coreSpotlightDisplayNameExpression(&self) -> Retained<NSExpression>;
255
256        /// Setter for [`coreSpotlightDisplayNameExpression`][Self::coreSpotlightDisplayNameExpression].
257        #[unsafe(method(setCoreSpotlightDisplayNameExpression:))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn setCoreSpotlightDisplayNameExpression(
260            &self,
261            core_spotlight_display_name_expression: &NSExpression,
262        );
263    );
264}
265
266/// Methods declared on superclass `NSObject`.
267impl NSEntityDescription {
268    extern_methods!(
269        #[unsafe(method(init))]
270        #[unsafe(method_family = init)]
271        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
272
273        #[unsafe(method(new))]
274        #[unsafe(method_family = new)]
275        pub unsafe fn new() -> Retained<Self>;
276    );
277}