objc2_core_data/generated/
NSEntityMapping.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSEntityMappingType(pub NSUInteger);
15impl NSEntityMappingType {
16 #[doc(alias = "NSUndefinedEntityMappingType")]
17 pub const UndefinedEntityMappingType: Self = Self(0x00);
18 #[doc(alias = "NSCustomEntityMappingType")]
19 pub const CustomEntityMappingType: Self = Self(0x01);
20 #[doc(alias = "NSAddEntityMappingType")]
21 pub const AddEntityMappingType: Self = Self(0x02);
22 #[doc(alias = "NSRemoveEntityMappingType")]
23 pub const RemoveEntityMappingType: Self = Self(0x03);
24 #[doc(alias = "NSCopyEntityMappingType")]
25 pub const CopyEntityMappingType: Self = Self(0x04);
26 #[doc(alias = "NSTransformEntityMappingType")]
27 pub const TransformEntityMappingType: Self = Self(0x05);
28}
29
30unsafe impl Encode for NSEntityMappingType {
31 const ENCODING: Encoding = NSUInteger::ENCODING;
32}
33
34unsafe impl RefEncode for NSEntityMappingType {
35 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern_class!(
39 #[unsafe(super(NSObject))]
41 #[derive(Debug, PartialEq, Eq, Hash)]
42 pub struct NSEntityMapping;
43);
44
45extern_conformance!(
46 unsafe impl NSObjectProtocol for NSEntityMapping {}
47);
48
49impl NSEntityMapping {
50 extern_methods!(
51 #[unsafe(method(name))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn name(&self) -> Retained<NSString>;
54
55 #[unsafe(method(setName:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setName(&self, name: Option<&NSString>);
61
62 #[unsafe(method(mappingType))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn mappingType(&self) -> NSEntityMappingType;
65
66 #[unsafe(method(setMappingType:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setMappingType(&self, mapping_type: NSEntityMappingType);
70
71 #[unsafe(method(sourceEntityName))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn sourceEntityName(&self) -> Option<Retained<NSString>>;
74
75 #[unsafe(method(setSourceEntityName:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setSourceEntityName(&self, source_entity_name: Option<&NSString>);
81
82 #[unsafe(method(sourceEntityVersionHash))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn sourceEntityVersionHash(&self) -> Option<Retained<NSData>>;
85
86 #[unsafe(method(setSourceEntityVersionHash:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setSourceEntityVersionHash(
92 &self,
93 source_entity_version_hash: Option<&NSData>,
94 );
95
96 #[unsafe(method(destinationEntityName))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn destinationEntityName(&self) -> Option<Retained<NSString>>;
99
100 #[unsafe(method(setDestinationEntityName:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn setDestinationEntityName(&self, destination_entity_name: Option<&NSString>);
106
107 #[unsafe(method(destinationEntityVersionHash))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn destinationEntityVersionHash(&self) -> Option<Retained<NSData>>;
110
111 #[unsafe(method(setDestinationEntityVersionHash:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn setDestinationEntityVersionHash(
117 &self,
118 destination_entity_version_hash: Option<&NSData>,
119 );
120
121 #[cfg(feature = "NSPropertyMapping")]
122 #[unsafe(method(attributeMappings))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn attributeMappings(&self) -> Option<Retained<NSArray<NSPropertyMapping>>>;
125
126 #[cfg(feature = "NSPropertyMapping")]
127 #[unsafe(method(setAttributeMappings:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setAttributeMappings(
131 &self,
132 attribute_mappings: Option<&NSArray<NSPropertyMapping>>,
133 );
134
135 #[cfg(feature = "NSPropertyMapping")]
136 #[unsafe(method(relationshipMappings))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn relationshipMappings(&self) -> Option<Retained<NSArray<NSPropertyMapping>>>;
139
140 #[cfg(feature = "NSPropertyMapping")]
141 #[unsafe(method(setRelationshipMappings:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setRelationshipMappings(
145 &self,
146 relationship_mappings: Option<&NSArray<NSPropertyMapping>>,
147 );
148
149 #[unsafe(method(sourceExpression))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn sourceExpression(&self) -> Option<Retained<NSExpression>>;
152
153 #[unsafe(method(setSourceExpression:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn setSourceExpression(&self, source_expression: Option<&NSExpression>);
157
158 #[unsafe(method(userInfo))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;
161
162 #[unsafe(method(setUserInfo:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
170
171 #[unsafe(method(entityMigrationPolicyClassName))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn entityMigrationPolicyClassName(&self) -> Option<Retained<NSString>>;
174
175 #[unsafe(method(setEntityMigrationPolicyClassName:))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn setEntityMigrationPolicyClassName(
181 &self,
182 entity_migration_policy_class_name: Option<&NSString>,
183 );
184 );
185}
186
187impl NSEntityMapping {
189 extern_methods!(
190 #[unsafe(method(init))]
191 #[unsafe(method_family = init)]
192 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193
194 #[unsafe(method(new))]
195 #[unsafe(method_family = new)]
196 pub unsafe fn new() -> Retained<Self>;
197 );
198}