use crate::common::*;
use crate::CoreData::*;
use crate::Foundation::*;
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPersistentContainer;
unsafe impl ClassType for NSPersistentContainer {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSPersistentContainer {
#[method_id(@__retain_semantics Other persistentContainerWithName:)]
pub unsafe fn persistentContainerWithName(name: &NSString) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other persistentContainerWithName:managedObjectModel:)]
pub unsafe fn persistentContainerWithName_managedObjectModel(
name: &NSString,
model: &NSManagedObjectModel,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Other defaultDirectoryURL)]
pub unsafe fn defaultDirectoryURL() -> Id<NSURL, Shared>;
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Id<NSString, Shared>;
#[method_id(@__retain_semantics Other viewContext)]
pub unsafe fn viewContext(&self) -> Id<NSManagedObjectContext, Shared>;
#[method_id(@__retain_semantics Other managedObjectModel)]
pub unsafe fn managedObjectModel(&self) -> Id<NSManagedObjectModel, Shared>;
#[method_id(@__retain_semantics Other persistentStoreCoordinator)]
pub unsafe fn persistentStoreCoordinator(&self)
-> Id<NSPersistentStoreCoordinator, Shared>;
#[method_id(@__retain_semantics Other persistentStoreDescriptions)]
pub unsafe fn persistentStoreDescriptions(
&self,
) -> Id<NSArray<NSPersistentStoreDescription>, Shared>;
#[method(setPersistentStoreDescriptions:)]
pub unsafe fn setPersistentStoreDescriptions(
&self,
persistentStoreDescriptions: &NSArray<NSPersistentStoreDescription>,
);
#[method_id(@__retain_semantics Init initWithName:)]
pub unsafe fn initWithName(
this: Option<Allocated<Self>>,
name: &NSString,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithName:managedObjectModel:)]
pub unsafe fn initWithName_managedObjectModel(
this: Option<Allocated<Self>>,
name: &NSString,
model: &NSManagedObjectModel,
) -> Id<Self, Shared>;
#[method(loadPersistentStoresWithCompletionHandler:)]
pub unsafe fn loadPersistentStoresWithCompletionHandler(
&self,
block: &Block<(NonNull<NSPersistentStoreDescription>, *mut NSError), ()>,
);
#[method_id(@__retain_semantics New newBackgroundContext)]
pub unsafe fn newBackgroundContext(&self) -> Id<NSManagedObjectContext, Shared>;
#[method(performBackgroundTask:)]
pub unsafe fn performBackgroundTask(
&self,
block: &Block<(NonNull<NSManagedObjectContext>,), ()>,
);
}
);