objc2_core_data/generated/
NSPersistentCloudKitContainer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainerschemainitializationoptions?language=objc)
10// NS_OPTIONS
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSPersistentCloudKitContainerSchemaInitializationOptions(pub NSUInteger);
14bitflags::bitflags! {
15    impl NSPersistentCloudKitContainerSchemaInitializationOptions: NSUInteger {
16        #[doc(alias = "NSPersistentCloudKitContainerSchemaInitializationOptionsNone")]
17        const None = 0;
18        #[doc(alias = "NSPersistentCloudKitContainerSchemaInitializationOptionsDryRun")]
19        const DryRun = 1<<1;
20        #[doc(alias = "NSPersistentCloudKitContainerSchemaInitializationOptionsPrintSchema")]
21        const PrintSchema = 1<<2;
22    }
23}
24
25unsafe impl Encode for NSPersistentCloudKitContainerSchemaInitializationOptions {
26    const ENCODING: Encoding = NSUInteger::ENCODING;
27}
28
29unsafe impl RefEncode for NSPersistentCloudKitContainerSchemaInitializationOptions {
30    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33extern_class!(
34    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainer?language=objc)
35    #[unsafe(super(NSPersistentContainer, NSObject))]
36    #[derive(Debug, PartialEq, Eq, Hash)]
37    #[cfg(feature = "NSPersistentContainer")]
38    pub struct NSPersistentCloudKitContainer;
39);
40
41#[cfg(feature = "NSPersistentContainer")]
42unsafe impl Send for NSPersistentCloudKitContainer {}
43
44#[cfg(feature = "NSPersistentContainer")]
45unsafe impl Sync for NSPersistentCloudKitContainer {}
46
47#[cfg(feature = "NSPersistentContainer")]
48extern_conformance!(
49    unsafe impl NSObjectProtocol for NSPersistentCloudKitContainer {}
50);
51
52#[cfg(feature = "NSPersistentContainer")]
53impl NSPersistentCloudKitContainer {
54    extern_methods!(
55        #[unsafe(method(initializeCloudKitSchemaWithOptions:error:_))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn initializeCloudKitSchemaWithOptions_error(
58            &self,
59            options: NSPersistentCloudKitContainerSchemaInitializationOptions,
60        ) -> Result<(), Retained<NSError>>;
61
62        #[cfg(feature = "NSManagedObjectID")]
63        #[unsafe(method(canUpdateRecordForManagedObjectWithID:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn canUpdateRecordForManagedObjectWithID(
66            &self,
67            object_id: &NSManagedObjectID,
68        ) -> bool;
69
70        #[cfg(feature = "NSManagedObjectID")]
71        #[unsafe(method(canDeleteRecordForManagedObjectWithID:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn canDeleteRecordForManagedObjectWithID(
74            &self,
75            object_id: &NSManagedObjectID,
76        ) -> bool;
77
78        #[cfg(feature = "NSPersistentStore")]
79        #[unsafe(method(canModifyManagedObjectsInStore:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn canModifyManagedObjectsInStore(&self, store: &NSPersistentStore) -> bool;
82    );
83}
84
85/// Methods declared on superclass `NSPersistentContainer`.
86#[cfg(feature = "NSPersistentContainer")]
87impl NSPersistentCloudKitContainer {
88    extern_methods!(
89        #[unsafe(method(persistentContainerWithName:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn persistentContainerWithName(name: &NSString) -> Retained<Self>;
92
93        #[cfg(feature = "NSManagedObjectModel")]
94        #[unsafe(method(persistentContainerWithName:managedObjectModel:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn persistentContainerWithName_managedObjectModel(
97            name: &NSString,
98            model: &NSManagedObjectModel,
99        ) -> Retained<Self>;
100
101        #[unsafe(method(initWithName:))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn initWithName(this: Allocated<Self>, name: &NSString) -> Retained<Self>;
104
105        #[cfg(feature = "NSManagedObjectModel")]
106        #[unsafe(method(initWithName:managedObjectModel:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithName_managedObjectModel(
109            this: Allocated<Self>,
110            name: &NSString,
111            model: &NSManagedObjectModel,
112        ) -> Retained<Self>;
113    );
114}
115
116/// Methods declared on superclass `NSObject`.
117#[cfg(feature = "NSPersistentContainer")]
118impl NSPersistentCloudKitContainer {
119    extern_methods!(
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123
124        #[unsafe(method(new))]
125        #[unsafe(method_family = new)]
126        pub unsafe fn new() -> Retained<Self>;
127    );
128}