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        #[unsafe(method(setObjectsToInsert:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setObjectsToInsert(
55            &self,
56            objects_to_insert: Option<&NSArray<NSDictionary<NSString, AnyObject>>>,
57        );
58
59        #[cfg(feature = "block2")]
60        #[unsafe(method(dictionaryHandler))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn dictionaryHandler(
63            &self,
64        ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool>;
65
66        #[cfg(feature = "block2")]
67        /// Setter for [`dictionaryHandler`][Self::dictionaryHandler].
68        #[unsafe(method(setDictionaryHandler:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setDictionaryHandler(
71            &self,
72            dictionary_handler: Option<
73                &block2::DynBlock<
74                    dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
75                >,
76            >,
77        );
78
79        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
80        #[unsafe(method(managedObjectHandler))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn managedObjectHandler(
83            &self,
84        ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>;
85
86        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
87        /// Setter for [`managedObjectHandler`][Self::managedObjectHandler].
88        #[unsafe(method(setManagedObjectHandler:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setManagedObjectHandler(
91            &self,
92            managed_object_handler: Option<
93                &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
94            >,
95        );
96
97        #[cfg(feature = "NSPersistentStoreResult")]
98        #[unsafe(method(resultType))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn resultType(&self) -> NSBatchInsertRequestResultType;
101
102        #[cfg(feature = "NSPersistentStoreResult")]
103        /// Setter for [`resultType`][Self::resultType].
104        #[unsafe(method(setResultType:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setResultType(&self, result_type: NSBatchInsertRequestResultType);
107
108        #[unsafe(method(batchInsertRequestWithEntityName:objects:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn batchInsertRequestWithEntityName_objects(
111            entity_name: &NSString,
112            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
113        ) -> Retained<Self>;
114
115        #[cfg(feature = "block2")]
116        #[unsafe(method(batchInsertRequestWithEntityName:dictionaryHandler:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn batchInsertRequestWithEntityName_dictionaryHandler(
119            entity_name: &NSString,
120            handler: &block2::DynBlock<
121                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
122            >,
123        ) -> Retained<Self>;
124
125        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
126        #[unsafe(method(batchInsertRequestWithEntityName:managedObjectHandler:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn batchInsertRequestWithEntityName_managedObjectHandler(
129            entity_name: &NSString,
130            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
131        ) -> Retained<Self>;
132
133        #[deprecated]
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137
138        #[unsafe(method(initWithEntityName:objects:))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn initWithEntityName_objects(
141            this: Allocated<Self>,
142            entity_name: &NSString,
143            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
144        ) -> Retained<Self>;
145
146        #[cfg(feature = "NSEntityDescription")]
147        #[unsafe(method(initWithEntity:objects:))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn initWithEntity_objects(
150            this: Allocated<Self>,
151            entity: &NSEntityDescription,
152            dictionaries: &NSArray<NSDictionary<NSString, AnyObject>>,
153        ) -> Retained<Self>;
154
155        #[cfg(all(feature = "NSEntityDescription", feature = "block2"))]
156        #[unsafe(method(initWithEntity:dictionaryHandler:))]
157        #[unsafe(method_family = init)]
158        pub unsafe fn initWithEntity_dictionaryHandler(
159            this: Allocated<Self>,
160            entity: &NSEntityDescription,
161            handler: &block2::DynBlock<
162                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
163            >,
164        ) -> Retained<Self>;
165
166        #[cfg(all(
167            feature = "NSEntityDescription",
168            feature = "NSManagedObject",
169            feature = "block2"
170        ))]
171        #[unsafe(method(initWithEntity:managedObjectHandler:))]
172        #[unsafe(method_family = init)]
173        pub unsafe fn initWithEntity_managedObjectHandler(
174            this: Allocated<Self>,
175            entity: &NSEntityDescription,
176            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
177        ) -> Retained<Self>;
178
179        #[cfg(feature = "block2")]
180        #[unsafe(method(initWithEntityName:dictionaryHandler:))]
181        #[unsafe(method_family = init)]
182        pub unsafe fn initWithEntityName_dictionaryHandler(
183            this: Allocated<Self>,
184            entity_name: &NSString,
185            handler: &block2::DynBlock<
186                dyn Fn(NonNull<NSMutableDictionary<NSString, AnyObject>>) -> Bool,
187            >,
188        ) -> Retained<Self>;
189
190        #[cfg(all(feature = "NSManagedObject", feature = "block2"))]
191        #[unsafe(method(initWithEntityName:managedObjectHandler:))]
192        #[unsafe(method_family = init)]
193        pub unsafe fn initWithEntityName_managedObjectHandler(
194            this: Allocated<Self>,
195            entity_name: &NSString,
196            handler: &block2::DynBlock<dyn Fn(NonNull<NSManagedObject>) -> Bool>,
197        ) -> Retained<Self>;
198    );
199}
200
201/// Methods declared on superclass `NSObject`.
202#[cfg(feature = "NSPersistentStoreRequest")]
203impl NSBatchInsertRequest {
204    extern_methods!(
205        #[unsafe(method(new))]
206        #[unsafe(method_family = new)]
207        pub unsafe fn new() -> Retained<Self>;
208    );
209}