objc2_core_data/generated/
NSBatchInsertRequest.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/nsbatchinsertrequest?language=objc)
12    #[unsafe(super(NSPersistentStoreRequest, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSPersistentStoreRequest")]
15    pub struct NSBatchInsertRequest;
16);
17
18#[cfg(feature = "NSPersistentStoreRequest")]
19extern_conformance!(
20    unsafe impl NSCopying for NSBatchInsertRequest {}
21);
22
23#[cfg(feature = "NSPersistentStoreRequest")]
24unsafe impl CopyingHelper for NSBatchInsertRequest {
25    type Result = Self;
26}
27
28#[cfg(feature = "NSPersistentStoreRequest")]
29extern_conformance!(
30    unsafe impl NSObjectProtocol for NSBatchInsertRequest {}
31);
32
33#[cfg(feature = "NSPersistentStoreRequest")]
34impl NSBatchInsertRequest {
35    extern_methods!(
36        #[unsafe(method(entityName))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn entityName(&self) -> Retained<NSString>;
39
40        #[cfg(feature = "NSEntityDescription")]
41        #[unsafe(method(entity))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn entity(&self) -> Option<Retained<NSEntityDescription>>;
44
45        #[unsafe(method(objectsToInsert))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn objectsToInsert(
48            &self,
49        ) -> Option<Retained<NSArray<NSDictionary<NSString, AnyObject>>>>;
50
51        /// Setter for [`objectsToInsert`][Self::objectsToInsert].
52        ///
53        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
54        ///
55        /// # Safety
56        ///
57        /// `objects_to_insert` generic generic should be of the correct type.
58        #[unsafe(method(setObjectsToInsert:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setObjectsToInsert(
61            &self,
62            objects_to_insert: Option<&NSArray<NSDictionary<NSString, AnyObject>>>,
63        );
64
65        #[cfg(feature = "block2")]
66        /// # Safety
67        ///
68        /// The returned block's argument must be a valid pointer.
69        #[unsafe(method(dictionaryHandler))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn dictionaryHandler(
72            &self,
73        ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool>;
74
75        #[cfg(feature = "block2")]
76        /// Setter for [`dictionaryHandler`][Self::dictionaryHandler].
77        ///
78        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
79        ///
80        /// # Safety
81        ///
82        /// `dictionary_handler` block's argument generic should be of the correct type.
83        #[unsafe(method(setDictionaryHandler:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setDictionaryHandler(
86            &self,
87            dictionary_handler: Option<
88                &block2::DynBlock<
89                    dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
90                >,
91            >,
92        );
93
94        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
95        /// # Safety
96        ///
97        /// The returned block's argument must be a valid pointer.
98        #[unsafe(method(managedObjectHandler))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn managedObjectHandler(
101            &self,
102        ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>;
103
104        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
105        /// Setter for [`managedObjectHandler`][Self::managedObjectHandler].
106        ///
107        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
108        #[unsafe(method(setManagedObjectHandler:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setManagedObjectHandler(
111            &self,
112            managed_object_handler: Option<
113                &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
114            >,
115        );
116
117        #[cfg(feature = "NSPersistentStoreResult")]
118        #[unsafe(method(resultType))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn resultType(&self) -> NSBatchInsertRequestResultType;
121
122        #[cfg(feature = "NSPersistentStoreResult")]
123        /// Setter for [`resultType`][Self::resultType].
124        #[unsafe(method(setResultType:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setResultType(&self, result_type: NSBatchInsertRequestResultType);
127
128        /// # Safety
129        ///
130        /// `dictionaries` generic generic should be of the correct type.
131        #[unsafe(method(batchInsertRequestWithEntityName:objects:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn batchInsertRequestWithEntityName_objects(
134            entity_name: &NSString,
135            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
136        ) -> Retained<Self>;
137
138        #[cfg(feature = "block2")]
139        /// # Safety
140        ///
141        /// `handler` block's argument generic should be of the correct type.
142        #[unsafe(method(batchInsertRequestWithEntityName:dictionaryHandler:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn batchInsertRequestWithEntityName_dictionaryHandler(
145            entity_name: &NSString,
146            handler: &block2::DynBlock<
147                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
148            >,
149        ) -> Retained<Self>;
150
151        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
152        #[unsafe(method(batchInsertRequestWithEntityName:managedObjectHandler:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn batchInsertRequestWithEntityName_managedObjectHandler(
155            entity_name: &NSString,
156            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
157        ) -> Retained<Self>;
158
159        #[deprecated]
160        #[unsafe(method(init))]
161        #[unsafe(method_family = init)]
162        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163
164        /// # Safety
165        ///
166        /// `dictionaries` generic generic should be of the correct type.
167        #[unsafe(method(initWithEntityName:objects:))]
168        #[unsafe(method_family = init)]
169        pub unsafe fn initWithEntityName_objects(
170            this: Allocated<Self>,
171            entity_name: &NSString,
172            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
173        ) -> Retained<Self>;
174
175        #[cfg(feature = "NSEntityDescription")]
176        /// # Safety
177        ///
178        /// `dictionaries` generic generic should be of the correct type.
179        #[unsafe(method(initWithEntity:objects:))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn initWithEntity_objects(
182            this: Allocated<Self>,
183            entity: &NSEntityDescription,
184            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
185        ) -> Retained<Self>;
186
187        #[cfg(all(feature = "NSEntityDescription", feature = "block2"))]
188        /// # Safety
189        ///
190        /// `handler` block's argument generic should be of the correct type.
191        #[unsafe(method(initWithEntity:dictionaryHandler:))]
192        #[unsafe(method_family = init)]
193        pub unsafe fn initWithEntity_dictionaryHandler(
194            this: Allocated<Self>,
195            entity: &NSEntityDescription,
196            handler: &block2::DynBlock<
197                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
198            >,
199        ) -> Retained<Self>;
200
201        #[cfg(all(
202            feature = "NSEntityDescription",
203            feature = "NSManagedObject",
204            feature = "block2"
205        ))]
206        #[unsafe(method(initWithEntity:managedObjectHandler:))]
207        #[unsafe(method_family = init)]
208        pub unsafe fn initWithEntity_managedObjectHandler(
209            this: Allocated<Self>,
210            entity: &NSEntityDescription,
211            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
212        ) -> Retained<Self>;
213
214        #[cfg(feature = "block2")]
215        /// # Safety
216        ///
217        /// `handler` block's argument generic should be of the correct type.
218        #[unsafe(method(initWithEntityName:dictionaryHandler:))]
219        #[unsafe(method_family = init)]
220        pub unsafe fn initWithEntityName_dictionaryHandler(
221            this: Allocated<Self>,
222            entity_name: &NSString,
223            handler: &block2::DynBlock<
224                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
225            >,
226        ) -> Retained<Self>;
227
228        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
229        #[unsafe(method(initWithEntityName:managedObjectHandler:))]
230        #[unsafe(method_family = init)]
231        pub unsafe fn initWithEntityName_managedObjectHandler(
232            this: Allocated<Self>,
233            entity_name: &NSString,
234            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
235        ) -> Retained<Self>;
236    );
237}
238
239/// Methods declared on superclass `NSObject`.
240#[cfg(feature = "NSPersistentStoreRequest")]
241impl NSBatchInsertRequest {
242    extern_methods!(
243        #[unsafe(method(new))]
244        #[unsafe(method_family = new)]
245        pub unsafe fn new() -> Retained<Self>;
246    );
247}