objc2_core_data/generated/
NSPersistentStoreDescription.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/nspersistentstoredescription?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSPersistentStoreDescription;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for NSPersistentStoreDescription {}
19);
20
21unsafe impl CopyingHelper for NSPersistentStoreDescription {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for NSPersistentStoreDescription {}
27);
28
29impl NSPersistentStoreDescription {
30    extern_methods!(
31        #[unsafe(method(persistentStoreDescriptionWithURL:))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn persistentStoreDescriptionWithURL(url: &NSURL) -> Retained<Self>;
34
35        #[unsafe(method(type))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn r#type(&self) -> Retained<NSString>;
38
39        /// Setter for [`type`][Self::type].
40        ///
41        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
42        #[unsafe(method(setType:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn setType(&self, r#type: &NSString);
45
46        #[unsafe(method(configuration))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn configuration(&self) -> Option<Retained<NSString>>;
49
50        /// Setter for [`configuration`][Self::configuration].
51        ///
52        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
53        #[unsafe(method(setConfiguration:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setConfiguration(&self, configuration: Option<&NSString>);
56
57        #[unsafe(method(URL))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
60
61        /// Setter for [`URL`][Self::URL].
62        ///
63        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
64        #[unsafe(method(setURL:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setURL(&self, url: Option<&NSURL>);
67
68        #[unsafe(method(options))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn options(&self) -> Retained<NSDictionary<NSString, NSObject>>;
71
72        /// # Safety
73        ///
74        /// `option` should be of the correct type.
75        #[unsafe(method(setOption:forKey:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setOption_forKey(&self, option: Option<&NSObject>, key: &NSString);
78
79        #[unsafe(method(isReadOnly))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn isReadOnly(&self) -> bool;
82
83        /// Setter for [`isReadOnly`][Self::isReadOnly].
84        #[unsafe(method(setReadOnly:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setReadOnly(&self, read_only: bool);
87
88        #[unsafe(method(timeout))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn timeout(&self) -> NSTimeInterval;
91
92        /// Setter for [`timeout`][Self::timeout].
93        #[unsafe(method(setTimeout:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setTimeout(&self, timeout: NSTimeInterval);
96
97        #[unsafe(method(sqlitePragmas))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn sqlitePragmas(&self) -> Retained<NSDictionary<NSString, NSObject>>;
100
101        /// # Safety
102        ///
103        /// `value` should be of the correct type.
104        #[unsafe(method(setValue:forPragmaNamed:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setValue_forPragmaNamed(&self, value: Option<&NSObject>, name: &NSString);
107
108        #[unsafe(method(shouldAddStoreAsynchronously))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn shouldAddStoreAsynchronously(&self) -> bool;
111
112        /// Setter for [`shouldAddStoreAsynchronously`][Self::shouldAddStoreAsynchronously].
113        #[unsafe(method(setShouldAddStoreAsynchronously:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setShouldAddStoreAsynchronously(&self, should_add_store_asynchronously: bool);
116
117        #[unsafe(method(shouldMigrateStoreAutomatically))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn shouldMigrateStoreAutomatically(&self) -> bool;
120
121        /// Setter for [`shouldMigrateStoreAutomatically`][Self::shouldMigrateStoreAutomatically].
122        #[unsafe(method(setShouldMigrateStoreAutomatically:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setShouldMigrateStoreAutomatically(
125            &self,
126            should_migrate_store_automatically: bool,
127        );
128
129        #[unsafe(method(shouldInferMappingModelAutomatically))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn shouldInferMappingModelAutomatically(&self) -> bool;
132
133        /// Setter for [`shouldInferMappingModelAutomatically`][Self::shouldInferMappingModelAutomatically].
134        #[unsafe(method(setShouldInferMappingModelAutomatically:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setShouldInferMappingModelAutomatically(
137            &self,
138            should_infer_mapping_model_automatically: bool,
139        );
140
141        #[unsafe(method(initWithURL:))]
142        #[unsafe(method_family = init)]
143        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
144    );
145}
146
147/// Methods declared on superclass `NSObject`.
148impl NSPersistentStoreDescription {
149    extern_methods!(
150        #[unsafe(method(init))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
153
154        #[unsafe(method(new))]
155        #[unsafe(method_family = new)]
156        pub unsafe fn new() -> Retained<Self>;
157    );
158}
159
160/// NSPersistentCloudKitContainerAdditions.
161impl NSPersistentStoreDescription {
162    extern_methods!(
163        #[cfg(feature = "NSPersistentCloudKitContainerOptions")]
164        /// Use this property to apply customized instances of NSPersistentCloudKitContainerOptions to
165        /// a store description you wish to use with CloudKit.
166        #[unsafe(method(cloudKitContainerOptions))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn cloudKitContainerOptions(
169            &self,
170        ) -> Option<Retained<NSPersistentCloudKitContainerOptions>>;
171
172        #[cfg(feature = "NSPersistentCloudKitContainerOptions")]
173        /// Setter for [`cloudKitContainerOptions`][Self::cloudKitContainerOptions].
174        #[unsafe(method(setCloudKitContainerOptions:))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn setCloudKitContainerOptions(
177            &self,
178            cloud_kit_container_options: Option<&NSPersistentCloudKitContainerOptions>,
179        );
180    );
181}