use crate::common::*;
use crate::CoreData::*;
use crate::Foundation::*;
ns_options!(
#[underlying(NSUInteger)]
pub enum NSPersistentCloudKitContainerSchemaInitializationOptions {
NSPersistentCloudKitContainerSchemaInitializationOptionsNone = 0,
NSPersistentCloudKitContainerSchemaInitializationOptionsDryRun = 1 << 1,
NSPersistentCloudKitContainerSchemaInitializationOptionsPrintSchema = 1 << 2,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
pub struct NSPersistentCloudKitContainer;
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl ClassType for NSPersistentCloudKitContainer {
#[inherits(NSObject)]
type Super = NSPersistentContainer;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl Send for NSPersistentCloudKitContainer {}
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl Sync for NSPersistentCloudKitContainer {}
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl NSObjectProtocol for NSPersistentCloudKitContainer {}
extern_methods!(
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl NSPersistentCloudKitContainer {
#[cfg(feature = "Foundation_NSError")]
#[method(initializeCloudKitSchemaWithOptions:error:_)]
pub unsafe fn initializeCloudKitSchemaWithOptions_error(
&self,
options: NSPersistentCloudKitContainerSchemaInitializationOptions,
) -> Result<(), Id<NSError>>;
#[cfg(feature = "CoreData_NSManagedObjectID")]
#[method(canUpdateRecordForManagedObjectWithID:)]
pub unsafe fn canUpdateRecordForManagedObjectWithID(
&self,
object_id: &NSManagedObjectID,
) -> bool;
#[cfg(feature = "CoreData_NSManagedObjectID")]
#[method(canDeleteRecordForManagedObjectWithID:)]
pub unsafe fn canDeleteRecordForManagedObjectWithID(
&self,
object_id: &NSManagedObjectID,
) -> bool;
#[cfg(feature = "CoreData_NSPersistentStore")]
#[method(canModifyManagedObjectsInStore:)]
pub unsafe fn canModifyManagedObjectsInStore(&self, store: &NSPersistentStore) -> bool;
}
);
extern_methods!(
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl NSPersistentCloudKitContainer {
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other persistentContainerWithName:)]
pub unsafe fn persistentContainerWithName(name: &NSString) -> Id<Self>;
#[cfg(all(
feature = "CoreData_NSManagedObjectModel",
feature = "Foundation_NSString"
))]
#[method_id(@__retain_semantics Other persistentContainerWithName:managedObjectModel:)]
pub unsafe fn persistentContainerWithName_managedObjectModel(
name: &NSString,
model: &NSManagedObjectModel,
) -> Id<Self>;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Init initWithName:)]
pub unsafe fn initWithName(this: Allocated<Self>, name: &NSString) -> Id<Self>;
#[cfg(all(
feature = "CoreData_NSManagedObjectModel",
feature = "Foundation_NSString"
))]
#[method_id(@__retain_semantics Init initWithName:managedObjectModel:)]
pub unsafe fn initWithName_managedObjectModel(
this: Allocated<Self>,
name: &NSString,
model: &NSManagedObjectModel,
) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "CoreData_NSPersistentCloudKitContainer")]
unsafe impl NSPersistentCloudKitContainer {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);