objc2_core_data/generated/
NSMappingModel.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/nsmappingmodel?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSMappingModel;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSMappingModel {}
19);
20
21impl NSMappingModel {
22    extern_methods!(
23        #[cfg(feature = "NSManagedObjectModel")]
24        #[unsafe(method(mappingModelFromBundles:forSourceModel:destinationModel:))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn mappingModelFromBundles_forSourceModel_destinationModel(
27            bundles: Option<&NSArray<NSBundle>>,
28            source_model: Option<&NSManagedObjectModel>,
29            destination_model: Option<&NSManagedObjectModel>,
30        ) -> Option<Retained<NSMappingModel>>;
31
32        #[cfg(feature = "NSManagedObjectModel")]
33        #[unsafe(method(inferredMappingModelForSourceModel:destinationModel:error:_))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn inferredMappingModelForSourceModel_destinationModel_error(
36            source_model: &NSManagedObjectModel,
37            destination_model: &NSManagedObjectModel,
38        ) -> Result<Retained<NSMappingModel>, Retained<NSError>>;
39
40        #[unsafe(method(initWithContentsOfURL:))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn initWithContentsOfURL(
43            this: Allocated<Self>,
44            url: Option<&NSURL>,
45        ) -> Option<Retained<Self>>;
46
47        #[cfg(feature = "NSEntityMapping")]
48        #[unsafe(method(entityMappings))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn entityMappings(&self) -> Option<Retained<NSArray<NSEntityMapping>>>;
51
52        #[cfg(feature = "NSEntityMapping")]
53        /// Setter for [`entityMappings`][Self::entityMappings].
54        #[unsafe(method(setEntityMappings:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setEntityMappings(&self, entity_mappings: Option<&NSArray<NSEntityMapping>>);
57
58        #[cfg(feature = "NSEntityMapping")]
59        #[unsafe(method(entityMappingsByName))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn entityMappingsByName(
62            &self,
63        ) -> Retained<NSDictionary<NSString, NSEntityMapping>>;
64    );
65}
66
67/// Methods declared on superclass `NSObject`.
68impl NSMappingModel {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new() -> Retained<Self>;
77    );
78}