objc2_core_data/generated/
NSManagedObjectModel.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/nsmanagedobjectmodel?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSManagedObjectModel;
15);
16
17extern_conformance!(
18    unsafe impl NSCoding for NSManagedObjectModel {}
19);
20
21extern_conformance!(
22    unsafe impl NSCopying for NSManagedObjectModel {}
23);
24
25unsafe impl CopyingHelper for NSManagedObjectModel {
26    type Result = Self;
27}
28
29extern_conformance!(
30    unsafe impl NSFastEnumeration for NSManagedObjectModel {}
31);
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for NSManagedObjectModel {}
35);
36
37impl NSManagedObjectModel {
38    extern_methods!(
39        #[unsafe(method(mergedModelFromBundles:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn mergedModelFromBundles(
42            bundles: Option<&NSArray<NSBundle>>,
43        ) -> Option<Retained<NSManagedObjectModel>>;
44
45        #[unsafe(method(modelByMergingModels:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn modelByMergingModels(
48            models: Option<&NSArray<NSManagedObjectModel>>,
49        ) -> Option<Retained<NSManagedObjectModel>>;
50
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[unsafe(method(initWithContentsOfURL:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithContentsOfURL(
58            this: Allocated<Self>,
59            url: &NSURL,
60        ) -> Option<Retained<Self>>;
61
62        #[cfg(feature = "NSEntityDescription")]
63        #[unsafe(method(entitiesByName))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn entitiesByName(
66            &self,
67        ) -> Retained<NSDictionary<NSString, NSEntityDescription>>;
68
69        #[cfg(feature = "NSEntityDescription")]
70        #[unsafe(method(entities))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn entities(&self) -> Retained<NSArray<NSEntityDescription>>;
73
74        #[cfg(feature = "NSEntityDescription")]
75        /// Setter for [`entities`][Self::entities].
76        #[unsafe(method(setEntities:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setEntities(&self, entities: &NSArray<NSEntityDescription>);
79
80        #[unsafe(method(configurations))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn configurations(&self) -> Retained<NSArray<NSString>>;
83
84        #[cfg(feature = "NSEntityDescription")]
85        #[unsafe(method(entitiesForConfiguration:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn entitiesForConfiguration(
88            &self,
89            configuration: Option<&NSString>,
90        ) -> Option<Retained<NSArray<NSEntityDescription>>>;
91
92        #[cfg(feature = "NSEntityDescription")]
93        #[unsafe(method(setEntities:forConfiguration:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setEntities_forConfiguration(
96            &self,
97            entities: &NSArray<NSEntityDescription>,
98            configuration: &NSString,
99        );
100
101        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
102        /// # Safety
103        ///
104        /// `fetch_request_template` generic should be bound by `NSFetchRequestResult`.
105        #[unsafe(method(setFetchRequestTemplate:forName:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn setFetchRequestTemplate_forName(
108            &self,
109            fetch_request_template: Option<&NSFetchRequest>,
110            name: &NSString,
111        );
112
113        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
114        #[unsafe(method(fetchRequestTemplateForName:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn fetchRequestTemplateForName(
117            &self,
118            name: &NSString,
119        ) -> Option<Retained<NSFetchRequest>>;
120
121        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
122        /// # Safety
123        ///
124        /// `variables` generic should be of the correct type.
125        #[unsafe(method(fetchRequestFromTemplateWithName:substitutionVariables:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn fetchRequestFromTemplateWithName_substitutionVariables(
128            &self,
129            name: &NSString,
130            variables: &NSDictionary<NSString, AnyObject>,
131        ) -> Option<Retained<NSFetchRequest>>;
132
133        #[unsafe(method(localizationDictionary))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn localizationDictionary(
136            &self,
137        ) -> Option<Retained<NSDictionary<NSString, NSString>>>;
138
139        /// Setter for [`localizationDictionary`][Self::localizationDictionary].
140        #[unsafe(method(setLocalizationDictionary:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setLocalizationDictionary(
143            &self,
144            localization_dictionary: Option<&NSDictionary<NSString, NSString>>,
145        );
146
147        /// # Safety
148        ///
149        /// `metadata` generic should be of the correct type.
150        #[unsafe(method(mergedModelFromBundles:forStoreMetadata:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn mergedModelFromBundles_forStoreMetadata(
153            bundles: Option<&NSArray<NSBundle>>,
154            metadata: &NSDictionary<NSString, AnyObject>,
155        ) -> Option<Retained<NSManagedObjectModel>>;
156
157        /// # Safety
158        ///
159        /// `metadata` generic should be of the correct type.
160        #[unsafe(method(modelByMergingModels:forStoreMetadata:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn modelByMergingModels_forStoreMetadata(
163            models: &NSArray<NSManagedObjectModel>,
164            metadata: &NSDictionary<NSString, AnyObject>,
165        ) -> Option<Retained<NSManagedObjectModel>>;
166
167        #[cfg(all(feature = "NSFetchRequest", feature = "NSPersistentStoreRequest"))]
168        #[unsafe(method(fetchRequestTemplatesByName))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn fetchRequestTemplatesByName(
171            &self,
172        ) -> Retained<NSDictionary<NSString, NSFetchRequest>>;
173
174        #[unsafe(method(versionIdentifiers))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn versionIdentifiers(&self) -> Retained<NSSet>;
177
178        /// Setter for [`versionIdentifiers`][Self::versionIdentifiers].
179        ///
180        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
181        ///
182        /// # Safety
183        ///
184        /// `version_identifiers` generic should be of the correct type.
185        #[unsafe(method(setVersionIdentifiers:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setVersionIdentifiers(&self, version_identifiers: &NSSet);
188
189        /// # Safety
190        ///
191        /// `metadata` generic should be of the correct type.
192        #[unsafe(method(isConfiguration:compatibleWithStoreMetadata:))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn isConfiguration_compatibleWithStoreMetadata(
195            &self,
196            configuration: Option<&NSString>,
197            metadata: &NSDictionary<NSString, AnyObject>,
198        ) -> bool;
199
200        #[unsafe(method(entityVersionHashesByName))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn entityVersionHashesByName(&self) -> Retained<NSDictionary<NSString, NSData>>;
203
204        #[unsafe(method(versionChecksum))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn versionChecksum(&self) -> Retained<NSString>;
207
208        #[unsafe(method(checksumsForVersionedModelAtURL:error:_))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn checksumsForVersionedModelAtURL_error(
211            model_url: &NSURL,
212        ) -> Result<Retained<NSDictionary<NSString, NSString>>, Retained<NSError>>;
213    );
214}
215
216/// Methods declared on superclass `NSObject`.
217impl NSManagedObjectModel {
218    extern_methods!(
219        #[unsafe(method(new))]
220        #[unsafe(method_family = new)]
221        pub unsafe fn new() -> Retained<Self>;
222    );
223}